-
• #5902
For realz.
-
• #5903
That's still hard.
I'd probably have to re-architect stuff.
Updates are expensive to calculate, and calculating the unread status at the same time (currently a per-item calculation) would be too much.
-
• #5904
Shame. But fair enough.
-
• #5905
Actually, it would be relatively easy to do it with a client side post processor script, like script monkey. Or whatever it's called.
-
• #5906
Where's the code that puts the yellow "new" tags in the page? Surely you must be calculating the unread status at some point to add them?
-
• #5907
It's pretty neat... I calculate a whole set of results and the quantity of results, and then use a windowing function to reduce the data to just that which I'm going to show on the page, and then only calculate the unread/new status for the items I'm then going to show.
What this means is that the query has a predictable speed even if I'm asking for 25 items or 20,000.
Explained:
Here's the query that fetches updates:
https://github.com/microcosm-cc/microcosm/blob/master/models/updates.go#L329-L501Here's the bit of interest:
https://github.com/microcosm-cc/microcosm/blob/master/models/updates.go#L349-L370The inner select is dealing with all updates (in my case 179 pages of 25 items per page = 4,475 conversations/mentions/huddles).
The inner select has a
COUNT(*) OVER() AS total
to find the number of items.Then the outer select is linked to:
https://github.com/microcosm-cc/microcosm/blob/master/models/updates.go#L498-L500Which windows the results to whichever 25 items you are viewing on a page... and the SELECT is then calling the
has_unread
that flags the unread/new status.has_unread
looks like this:
https://github.com/microcosm-cc/microcosm/blob/master/db/migrations/20151112231934_is_unread.sql#L6-L348And if you read through that you'll see it's a row level function... can't be JOIN'd to a table to get new things, it's a question you ask per row.
The reason for that is how unread status is stored... it's space efficient and item query efficient:
https://github.com/microcosm-cc/microcosm/blob/master/db/migrations/20150930224827_initial.sql#L4584-L4596I store the last time you have read something, but it's an implicit hierarchy.
If you mark a forum as read, then any rows in that table for the items you have read are then deleted as storing just the forum and that implicitly meaning "all items in the forum are read" is more efficient.
To make "following" filterable I'd need to find a way to make the
has_unread
function a SQL view so that I could JOIN against it. -
• #5908
Cool stuff.
Thanks for the explanation.
-
• #5909
Added the ability to get an email when a new member registers.
This is done by following the People page... which has no effect if you're not also opting to receive instant email notifications.
The emails are useful indicators for new websites on the platform, but not terrible useful. The usefulness is reduced by the fact that at the time I send the email, it's immediately after they've been registered and thus they have not yet filled in their username or avatar. But it can be helpful for small forums, as it gives them a chance to go check new users when they might not otherwise have known someone signed-up.
-
• #5910
Posts don't appear synced between browsers - I'm logged in on FF and can see up to post 6823 in the dangerous drivers thread, but logged out on Chromium and I can only see up to post 6821
-
• #5911
When you are signed-out, you are viewing the cache.
When you are signed-in, you are viewing the very latest items available.
The cache for those signed-out, is set to 300 seconds = 5 minutes. This means that at most, conversations may be 5 minutes out of date if you are not signed-in.
-
• #5912
Gotcha - thanks for explaining it
-
• #5913
Is there a way to see exactly which post a post is 'in reply to', if it doesn't jump exactly to the post when you click on the link and there are a few posts by the same person in approx the same place?
-
• #5914
This is caused by images taking a while to load and the page jumping.
Put your cursor in the address bar, hit enter. It will jump to the address, and as the page is already loaded it will only re-align the comment with the one that you are looking for.
-
• #5915
Clicking on the comment number of the reply should take you to a single comment (or sometimes a thread of comments, it seems a bit arbitrary) which was the original post.
-
• #5916
Clicking on:
in reply to
takes you to the comment in the context of the thread in which it appears, which may be on the same page but higher up, or may be an earlier page in the thread.#number
in the top right of a comment, takes you to a permalink to the comment as a standalone thing, and if the comment was in reply to another then it will show the parent there, and if other comments were in reply to it then those appear below the comment.
Use the first to see how it appeared in the grand scheme of things.
Use the latter to have a permanent record of "this was in reply to that, and had all these responses too".
i.e. this is the numbered link to your comment: https://www.lfgss.com/comments/13057597/ and you can see it with all of it's interactions around it.
-
• #5917
The arbitrary bit seems to be what comes up when you click on a comment number. For instance clicking on the second comment in a three comment thread gives you all 3 comments as expected https://www.lfgss.com/comments/13057398/
Clicking on the third comment only gives you the 2nd and 3rd comment https://www.lfgss.com/comments/13057404/
-
• #5918
- 1 parent comment.
- The comment with the box around is the focus of the link.
- 1 or more immediate child comments.
I can't show "all parents" in a long chain as it's potentially very long and the focus of the link then becomes hard to see.
- 1 parent comment.
-
• #5919
Thanks, both!
-
• #5920
I assumed that was the intention but I'm not quite sure what purpose it serves. Being able to see the whole chain, particularly if it's very long, would be an easy way to read it.
It may sometimes end up convoluted where there are multiple replies but it's still easier than clicking on each comment to get to the next in the chain.
If you want to see the specific comment it's reply to then there is the option of clicking in reply to.
-
• #5921
I don't disagree.
It originally was trying to be this kind of page: https://twitter.com/njagnz/status/745022671755317248
But it turns out that as replies on here can be much longer, that it was really hard to follow the "in reply to" chain as lengthy replies, images and other things made it unreadable.
But it was really easy to read all of the replies, so we focused on those.
-
• #5922
Will we ever see rep again?
..has this been resolved yet?
-
• #5923
Can't upload photos either from phone or desktop.
-
• #5924
test
1 Attachment
-
• #5925
Can you email me the file you cannot upload, and let me know the browser and OS that you are using.
The system still appears to be working fine, new attachments are being made constantly, so it must be something about your setup or the file itself (too big?).
Alternatively, try CTRL+F5 or equivalent on this page as maybe you have a corrupt JS file in your cache?
Could we get the same feature on the following page please?