-
• #18677
The Following tab can duplicate things if you're being notified by several criteria at once.
-
• #18678
Feel free to help improve this query:
https://github.com/microcosm-cc/microcosm/blob/master/models/updates.go#L329-L487 -
• #18679
I can't program, but I can think, I solved this issue in excel by ordering a list alphabetically, check if row n = row n-1, delete if it does. Reorder by date/time, publish.
-
• #18680
That manual process applied to a spreadsheet on your laptop is one thing. Managing data at scale in an automated fashion in an online application with a large number of concurrent users is a whole different context.
But hey, how hard can it be? It works on your laptop.
-
• #18681
There are shortcuts to this in database query languages - I thought it was more a design decision over whether it's beneficial to have the same thread shown twice in the stream because the context differs in each instance.
i.e. if I @Backstop you then it's likely this thread shows up twice for you because I've both replied and included your handle in the post.
Or something.
-
• #18682
Why are you so spicy these days?
-
• #18683
I can't program, but I can think,
Got just as much spice as it merited. mashton was joking, but that's just "How hard can it be?" with extra peeve.
-
• #18684
Well quite, I suspect it might not be optimal but that's rarely the bar for posting on here!
Also, it was not meant to be taken very seriously.
-
• #18685
Consider me triggered. It's my area of work, where both "it works on my laptop" and "It's simple in Excel so it must be easy in your database" are particularly prickly red rags.
-
• #18686
I mean... it might be as simple as removing the
update_id
andupdate_type_id
from theUNION
so that theGROUP BY
merges the duplicates.Hmm... no, wouldn't work... because then I could never determine how to render the items as "someone mentioned you" etc... nor which email notifications to send.
Maybe I could do all of the queries individually in advance and implement
UNION
in code once I've read them, or even in a SQL query which chooses rowsWHERE NOT EXISTS
.Hmm... no, wouldn't work. On the first page this would be fine, but once you start paginating updates each query would track a different offset depending on the number of items for that type of update.
Hmm.
I can't think of any obvious way to avoid it within the query.
But maybe it can just be done in code when rendered... it would lead to uneven pages where if duplicates were discovered one was removed. So sometimes on these edge cases there would be 23 updates on a page rather than 25 updates... but this is probably OK, you might never even notice the unequal page lengths. It wouldn't solve duplicates that spanned pages, but again you probably wouldn't notice.
So it seems like this could be done at render time... keep updates only if the item hasn't already been shown.
Which leads to another question... what to keep? Probably the most specific... i.e. keep mentions above "someone commented", keep "you posted" above "new thread in forum".
To do that probably needs a double-parsing within the API that returns the updates. This is doable, at that point the slice is only 25 items and all in memory so it wouldn't hurt, and this is only on the updates page as the search page doesn't have this problem.
So that's an idea of how this could be done... remove duplicates within the API post-query but pre-render.
-
• #18687
Edit: never mind, comment is unnecessary after having refreshed the page
-
• #18688
Yea, I don't envy IT in a commercial/employee type situation.
I didn't want to suggest that "thinking" was a greater intellectual activity than programming.
-
• #18689
But maybe it can just be done in code when rendered..
That's what I said.
-
• #18690
Would hear you like to race conditions about a joke?
-
• #18691
Excellent marketing technique btw Fizzy.
-
• #18692
#triggered...
IT and programming aren't necessarily the same thing.
While at university studying computer science I bought a t-shirt which said "No I will not fix your computer". Has been relevant on multiple occasions since.
-
• #18693
fuck all good it's done :(
-
• #18694
Wow my hero
-
• #18695
Have you tried turning it off and on again?
-
• #18696
While at university studying computer science I bought a t-shirt which said "No I will not fix your computer". Has been relevant on multiple occasions since.
I used to go round to their room, look at it for a minute or so and then ask them to pass me a big hammer.
-
• #18697
Was this before or after you asked to borrow their D20?
-
• #18699
Could move this one too, I’ll then do some updates! https://www.lfgss.com/conversations/283213/?offset=75#comment14620733
-
• #18700
Moved those two threads
Who wrote this shonky forum software. Eh?