-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: recordings ordering #24794
feat: recordings ordering #24794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, some failing tests w.r.t assigning start_time
instead of latest
it looks like
72b533e
to
dd6baf2
Compare
@neilkakkar requested a re-review because I added in the random sample stuff and felt like things had changed enough. Will comment where things have changed |
@@ -54,7 +73,7 @@ describe('sessionRecordingsPlaylistLogic', () => { | |||
return [ | |||
200, | |||
{ | |||
results: [`List of recordings offset by ${listOfSessionRecordings.length}`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sortRecordings
function did not like that this was not an object
|
||
def _order_by_clause(self) -> ast.OrderExpr: | ||
expr = ( | ||
ast.Call(name="sipHash64", args=[ast.Field(chain=["session_id"])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main addition here @neilkakkar. Idea is that it generates a hash based on the session id and uses that to pick a random but (mostly deterministic) ordering of recordings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unnecessary 🤔 , unless the worry is around pagination here? You can do order by rand()
if you just want a random sampling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was trying to keep things consistent around pagination, link sharing and repeated runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the hash is consistent, does this mean the first page after you select random will always be the same? 😅 Again not sure if this is more confusing than it changing every time (and then being able to sort that result list).
I think we can relax the product constraint of pagination working appropriately when random sampling is chosen perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a user I'd potentially like to be like a gacha, every time I click the toggle I get different recordings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i commented elsewhere but i'll add it here so there's one thread :)
i don't think I get random... why?
(it also feels wrong that it's consistently random, if i toggle it on and off i get the same random list each time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok, i read the linked issue... fair enough :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make sure we get metrics on what people are choosing / loading ??
Size Change: 0 B Total Size: 1.1 MB ℹ️ View Unchanged
|
frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts
Outdated
Show resolved
Hide resolved
}, | ||
]} | ||
size="small" | ||
value={orderBy as string} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably avoid this cast by properly typing the options but they're nested and i'm lazy 🤣
@@ -417,7 +429,14 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic | |||
'start_time' as RecordingsQuery['order'], | |||
{ persist: true }, | |||
{ | |||
setOrderBy: (_, { orderBy }) => orderBy, | |||
setOrderBy: (_, { orderBy }) => orderBy as RecordingsQuery['order'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
casting here to make other typing easier. it's still protected by the typing on the setOrderBy
param
setOrderBy: (_, { orderBy }) => orderBy as RecordingsQuery['order'], | ||
}, | ||
], | ||
randomSample: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I get the use for random sample (especially since it appears to be a persistent randomness when toggling the sampling on and off)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original thinking was in #8182
Tbh I might just remove it for now because I can foresee it causing customer confusion if there's misunderstanding about it and it hasn't made it past the PR 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the 8182 is "matching examples from a wider date range"
i.e. not each consecutive recording, not random recordings, just one from each day or whatever
considering it's not come up again, i'd strip it out of here, yep
then we can test if selecting something other then latest for people affects behaviour - which is what i'm really excited about
- do people choose this themselves
- what happens if we choose it for them
that's why i'd suggest making it front and center so we can see if they change away as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, top and right not front and center 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to change my typing, er, typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh... and we have a random sample toggle, and a random ordering in the menu... so i can choose random random 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
… into dn-feat/replay-filtering
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated3 snapshot changes in total. 0 added, 3 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Problem
Order replays!
Randomly choose replays! (closes #8182)
Changes
Does this work well for both Cloud and self-hosted?
Yes
How did you test this code?
Added a test