Yago
(Santiago Bernabé García)
March 26, 2026, 9:14am
1
Hi all! We’re facing the following issue, don’t know if someone has the same problem: in the course discussions tab, we see the messages not organized propertly, or not at least as expected.
Lets say we want all the messages ordered by “recent first”, but the first messages shown are from weeks ago, when there are messages created 3 days ago (see the screenshot below)
Is there ay reason for this behaviour or is it a tutor-forums bug? We are using edx-platform release/teak.3 and tutor@v20.0.5 tutor-forum@20.0.0
Thanks for any help in advance
Regards
PD: this might be related with [Bug] Response sort option is not working · Issue #823 · openedx/frontend-app-discussions
pdpinch
(Peter Pinch)
March 26, 2026, 11:27am
2
Hi Yago. We are experiencing the same behavior in Ulmo. For us, it started after we migrated to the V2 discussion forums, but we haven’t been able to pinpoint the cause yet.
Peter Pinch
MIT Open Learning
sarina
(Sarina Canelake)
March 26, 2026, 3:48pm
3
Tagging @aayub - do you have any advice?
pdpinch:
the V2 discussion forums
It was this way for us as well. If I recall correctly it had something to do with the “pinned” column in the database. It was either 0, 1 or null which caused the sorting to be messed up. Once we defaulted “pinned” to 0, it seemed to fix the issue.
aayub
(Aamir Ayub (Arbisoft))
March 26, 2026, 5:21pm
5
No advice but i’ve informed the team who worked on forum v2.
I’m looking into it and will fix this asap
The fix was merged in master some time ago so I have created 2 backport PRs for releases Teak and UImo
release/teak ← edly-io:backport/openedx-forum-0.4.1-teak
opened 08:52AM - 04 Jun 26 UTC
## Summary
Bumps the `openedx-forum` pin from **0.4.0** to **0.4.1** on `releas… e/teak` to backport the fix for the discussion-forum "pinned"-NULL sort bug.
- **Bug:** Threads sorted by *recent first* showed old threads above newer ones — the `pinned` column on `CommentThread` could be `NULL` (in addition to `0`/`1`), and SQL's NULL ordering scrambled the `ORDER BY -pinned, last_activity_at` result.
- **Upstream fix:** [openedx/forum#270](https://github.com/openedx/forum/pull/270) (commit `78b36e4`) — sets `default=False` on the `pinned` model field and backfills existing `NULL` rows via migration `0005_alter_commentthread_pinned`. Released as forum `0.4.1` on 2026-03-30.
- **User report:** https://discuss.openedx.org/t/discuss-forum-messages-order-not-organized-as-expected-in-teak/18665
## Why cap at 0.4.1?
A constraint `openedx-forum<=0.4.1` is added to `requirements/constraints.txt` to keep the Teak line on the safe side of two breaking releases:
| forum tag | change | safe for Teak? |
|---|---|---|
| 0.4.1 | **The fix** + adds optional Typesense search backend (off by default) | ✅ |
| 0.4.2 | Drops Python 3.11 support | ❌ (Teak supports 3.11) |
| 0.4.3 | Removes the MongoDB backend | ❌ (Teak deployments may still use MongoDB) |
The constraint should be dropped on `master` / post-Teak release lines.
## Files changed
- `requirements/constraints.txt` — adds the `openedx-forum<=0.4.1` cap with an explanatory comment block.
- `requirements/edx/{base,development,testing,doc}.txt` — bumps the pinned `openedx-forum` line from 0.4.0 → 0.4.1, and adds the new transitive `typesense==2.0.0` dep that 0.4.1 pulls in.
If preferred, maintainers can re-run `make upgrade-package package=openedx-forum` to regenerate the compiled files canonically — the resulting diff should match this PR.
## Test plan
- [ ] Tutor Teak deployment running `openedx-forum==0.4.1` no longer shows old threads at the top of "recent first" sort.
- [ ] Forum migration `0005_alter_commentthread_pinned` applies cleanly and `pinned` column has no `NULL` rows after `manage.py lms migrate`.
- [ ] CI passes — `make upgrade-package package=openedx-forum` produces no further changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
release/ulmo ← edly-io:backport/openedx-forum-0.4.1-ulmo
opened 09:13AM - 04 Jun 26 UTC
## Summary
Bumps the `openedx-forum` pin from **0.3.8** to **0.4.1** on `releas… e/ulmo` to backport the fix for the discussion-forum "pinned"-NULL sort bug.
- **Bug:** Threads sorted by *recent first* showed old threads above newer ones — the `pinned` column on `CommentThread` could be `NULL` (in addition to `0`/`1`), and SQL's NULL ordering scrambled the `ORDER BY -pinned, last_activity_at` result.
- **Upstream fix:** [openedx/forum#270](https://github.com/openedx/forum/pull/270) (commit `78b36e4`) — sets `default=False` on the `pinned` model field and backfills existing `NULL` rows via migration `0005_alter_commentthread_pinned`. Released as forum `0.4.1` on 2026-03-30.
- **User report:** https://discuss.openedx.org/t/discuss-forum-messages-order-not-organized-as-expected-in-teak/18665
Companion PR for `release/teak`: [#38709](https://github.com/openedx/edx-platform/pull/38709).
## What's in 0.3.8 → 0.4.1?
| forum tag | what it adds | safe for Ulmo? |
|---|---|---|
| 0.3.9 | Five small bug fixes (Mongo content_type, timestamps, MySQL read_states lookup, Forum V2 author field, build CI) | ✅ |
| 0.4.0 | MySQL backend N+1 / query optimizations (`select_related` / `prefetch_related`); backwards-compatible per commit message | ✅ |
| 0.4.1 | **The fix** + optional Typesense search backend (off by default) | ✅ |
## Why cap at 0.4.1?
A constraint `openedx-forum<=0.4.1` is added to `requirements/constraints.txt` to keep the Ulmo line on the safe side of two breaking releases:
| forum tag | change | safe for Ulmo? |
|---|---|---|
| 0.4.2 | Drops Python 3.11 support | ❌ if Ulmo still supports 3.11 |
| 0.4.3 | Removes the MongoDB backend | ❌ (Ulmo deployments may still use MongoDB) |
The constraint should be dropped on `master` / post-Ulmo release lines.
## Files changed
- `requirements/constraints.txt` — adds the `openedx-forum<=0.4.1` cap with an explanatory comment block.
- `requirements/edx/{base,development,testing,doc}.txt` — bumps the pinned `openedx-forum` line from 0.3.8 → 0.4.1, and adds the new transitive `typesense==2.0.0` dep that 0.4.1 pulls in.
`httpx`, `httpcore`, `h11`, and `anyio` (typesense's other transitive deps) are already pinned in `release/ulmo`'s `base.txt`, so the only new pin added is `typesense==2.0.0`.
If preferred, maintainers can re-run `make upgrade-package package=openedx-forum` to regenerate the compiled files canonically — the resulting diff should match this PR.
## Test plan
- [ ] Tutor Ulmo deployment running `openedx-forum==0.4.1` no longer shows old threads at the top of "recent first" sort.
- [ ] Forum migration `0005_alter_commentthread_pinned` applies cleanly and `pinned` column has no `NULL` rows after `manage.py lms migrate`.
- [ ] CI passes — `make upgrade-package package=openedx-forum` produces no further changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
I would need a maintainer to merge these. TIA.
dave
(Dave Ormsbee)
June 8, 2026, 3:50am
8
I’ve merged these changes.