I'm seeing "old posts" at the top of recent discussion list but only for anonymous users
Digging at the API it seems that the discussions controller returns sticky posts first, regardless of the sort asked for.
/api/discussions?sort=-lastPostedAt&include=lastPost
Does include most recently posted first BUT only after all the sticky discussions.
You can see this here, https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost that the first 3 are "sticky" and couple weeks old.
but when I login and then view the same API, the sticky posts drop to their appropriate place based on lastPostedAt
I know for some UI that might be desirable to show sticky, but assumed that would be an explicit ask of the API, and consistent across users. Seems some implicit magic I can;t see in the ListDiscussionsController.
Anonymous API call
// 20210515062158
// https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost
{
"links": {
"first": "https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost",
"next": "https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost&page%5Boffset%5D=20"
},
"data": [
{
"type": "discussions",
"id": "40",
"attributes": {
"title": "ADK Dual Sport Rides - Region 7: Clinton, Franklin & Lewis Counties",
"slug": "40-adk-dual-sport-rides-region-7-clinton-franklin-lewis-counties",
"commentCount": 2,
"participantCount": 1,
"createdAt": "2021-04-28T16:58:35+00:00",
"lastPostedAt": "2021-05-03T20:32:18+00:00",
...
"isSticky": true
},
Authenticatred API call
// 20210515061840
// https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost
{
"links": {
"first": "https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost",
"next": "https://adkadv.com/api/discussions?sort=-lastPostedAt&include=lastPost&page%5Boffset%5D=20"
},
"data": [
{
"type": "discussions",
"id": "42",
"attributes": {
"title": "Wolf Pond Road to Lyon Mountain",
"slug": "42-wolf-pond-road-to-lyon-mountain",
"commentCount": 9,
"participantCount": 3,
"createdAt": "2021-04-29T01:03:16+00:00",
"lastPostedAt": "2021-05-14T22:47:54+00:00",
...
"isSticky": false