Fixes T7757. Since anchor links can't be processed server side, we have to detect the message is old in javascript, then re-loaded the page. This opens up a new corner case where we have to paginate in newer messages, so this also adds support for that.
Details
- Reviewers
epriestley chad - Maniphest Tasks
- T7757: Conpherence rooms should offer permanent links to a specific message
- Commits
- Restricted Diffusion Commit
rPb199f7066c9c: Conpherence - add support for linking directly to messages regardless of age…
- set main query limit to 8 and then visited ZXX#YYY. noted a second quick load of YYY, that YYY ended up highlighted and scrolled to.
- used "show newer messages" and "show older messages" successfully, taking care to make sure transaction ids were all correct with no off by one errors, etc.
- opened and closed durable column to make sure that still works too
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
make sure to add newest_transaction_id to durable column call site (Note its always 0 in durable column, but thats cool.)
I can't actually get "Show Newer Messages" to show up -- when I follow a link to an old message, it just has a bunch of messages after it and then ends abruptly, somewhere further back in history than the present state. That said, this generally works fine.
I wonder if we maybe shouldn't just link to some kind of separate, non-interactive, permanent, paginated view for this and for search results. If I follow a link to #1 and the thread has 1 million messages in it, I assume nothing good happens if I try to add a new message. If we just took you to a separate history view instead that might simplify things.
Maybe I'll try building that for search (I don't want to try dealing with search + new messages interacting for v0 at least, anyway) and we can see if it feels too weird/separate or not.
"Show Newer Messages" should work... Are you messing with the limit at all or just happen to have 100+ messages in a thread to do this the right way? I'd like to resolve how come its not working for you as I think its kind of important.
I tried building this a few ways, including having a dialogue that was like "This message is old. Here it is with some context <$messages> Should we load the thread around then?"
...but basically it seems to me the expectation would be to drop right into the thread where ever the link linked you to.
I spammed a pile of legit messages, here's what I see when I follow a link with a hashtag to a very early one, which works fine:
When I scroll to the bottom, I see this:
But that's not the most recent message. If I go to the thread directly (with no hash) I get this:
Fix issue with "show newer messages" not showing up.
There was a bug where if you picked an old message that was within the first OLDER_FETCH_LIMIT messages, we wouldn't fetch enough total messages to trigger the overall limit conditional. As such, add a special case to just render the "show newer messages" transaction if we don't hit the total transaction limit.