-
Notifications
You must be signed in to change notification settings - Fork 0
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
mrc-4628 Filter out duplicate sessions from Sessions page #197
Conversation
@@ -283,9 +294,9 @@ export default defineComponent({ | |||
window.location.assign(link); | |||
}; | |||
|
|||
onMounted(() => { | |||
onMounted(async () => { | |||
await store.dispatch(AppStateAction.LoadUserPreferences); |
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.
We need to load user preferences now before fetching sessions metadata as we use the duplicates preference in query string parameter to the endpoint.
|
||
const saveMissingHashes = []; | ||
// eslint-disable-next-line no-restricted-syntax | ||
for await (const [idx, id] of ids.entries()) { |
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.
eslint doesn't like plain old for
s but this is preferable for including async in the loop
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
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 just spent a bit of time going through this, quite like the implementation! so basically we will now store hashes of the data, compare them and return the most recent one, definitely way cleaner looking sessions page
This branch gives the user a checkbox to filter out duplicate sessions from the Sessions page (checked by default). Unlabelled sessions which are duplicates of a later session will not be shown. Labelled sessions are always shown (I think users would be confused if their labelled session vanished because a later session happened to be identical).
Now that we're saving hashes for sessions in order to identify duplicates, we could potentially make a further change to only save the data for a hash once, rather than for every session separately. One for another ticket: https://mrc-ide.myjetbrains.com/youtrack/issue/mrc-4677