10000 [Data Cleaning] Updates to session status view by biyeun · Pull Request #36469 · dimagi/commcare-hq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Data Cleaning] Updates to session status view #36469

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

Merged
merged 14 commits into from
May 22, 2025
Merged

Conversation

biyeun
Copy link
Member
@biyeun biyeun commented May 21, 2025

Technical Summary

  • dry up the code surrounding the status modal, improving readability
  • make the progress bar feel more responsive by decreasing the polling time and simulating progress during the "buffering period"
  • decrease the buffering period to 3 seconds, with a note that we should update this value in the future based on real time change feed delays
  • remove unnecessary refreshes to table view after hitting apply changes

Note: I plan to address issues with the text content of the status modal in an upcoming PR. so that bit isn't a part of this PR

Feature Flag

DATA_CLEANING_CASES

Safety Assurance

Safety story

changes made to a feature flagged workflow that is undergoing user testing on staging

Automated test coverage

most important bits are tested, but more tests are coming

QA Plan

not blocking PR, as this still is feature flagged

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

biyeun added 12 commits May 21, 2025 17:56
- extract into a partial and dry things up
- i decrease this even further in a future commit to 0.5s, but I couldn’t squash the two due to other changes that happened in between
- add whitespace for readability improvement
- way too much overhead
- let the modal overlay with the status while the pending edits are visible in the background. this allows us to avoid the need of having to refresh the table constantly during the status progress. it's much easier to 'freeze' the view and let the user see the changes in the table after resuming the session
- we are no longer refreshing the table on each poll, so it's fine to increase
- gives a better feeling of responsiveness and fluidness to the user
- when a new session is created/resumed
- the session status modal is triggered when the partial first loads. add a comment about this in the modal template so that it's clear how it is being triggered.
- unfortunately we couldn't use HX-Trigger headers on the main view as the first loading of the whole page is not an HTMX request. as a result, it felt the cleanest to leave the triggering to the status view itself.
@biyeun biyeun added the product/feature-flag Change will only affect users who have a specific feature flag enabled label May 21, 2025
Copy link
Contributor
@gherceg gherceg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the small commits!

Comment on lines +11 to +14
{% blocktrans count count=num_records_changed %}
Finished processing changes, updated 1 case.
{% plural %}
Finished processing changes, updated {{ num_records_changed }} cases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy! I think I understand this, apart from count defined twice? But I'm assuming count is some special var that will factor into whether we use the singular or {% plural %} option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count is a special var for blocktrans, yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why does it need to be both specified and then assigned as opposed to just assigned?

@@ -14,7 +14,7 @@
BULK_OPERATION_CHUNK_SIZE = 1000
MAX_RECORDED_LIMIT = 100000
MAX_SESSION_CHANGES = 200
APPLY_CHANGES_WAIT_TIME = 15 # seconds
APPLY_CHANGES_WAIT_TIME = 3 # seconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the artificial buffer right? Is 3 seconds enough 😬?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it? I had to argue with @kcowger we need more, but he felt 15 was too much. but maybe someone from platform will offer better advice?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ultimately tie this to pillow lag then maybe it isn't too big of a deal? But I look at a graph like this which makes 3 seconds feel tough. Granted that graph is the max lag time so it paints the worst picture.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, we should tie to pillow lag. But the experience of making a single inline edit and waiting 15 seconds is terrible.

@@ -10,7 +10,7 @@
hx-post="{{ request.path_info }}{% querystring %}"
hq-hx-action="apply_all_changes"
hx-target="{% if table.container_id %}#{{ table.container_id }}{% else %}.table-container{% endif %}"
hx-swap="outerHTML"
hx-swap="none"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious how does this compare to not specifying hx-swap at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't specify hx-swap it defaults to innerHTML which is...definitely not what we want 😅

The buffer allows the change feed to catch up to the form submissions,
so that the user doesn't refresh and see that their data hasn't updated due to a slow change feed.

TODO: update this buffer (APPLY_CHANGES_WAIT_TIME) dynamically based on change feed status.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmitPhulera did some work on a PillowLagGaugeLimiter fyi. If nothing else would serve as a useful reference for pulling lag time.

….html

Co-authored-by: Graham Herceg <gherceg@dimagi.com>
@biyeun biyeun merged commit ccc855e into master May 22, 2025
17 checks passed
@biyeun biyeun deleted the bmb/dc/status-updates branch May 22, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/feature-flag Change will only affect users who have a specific feature flag enabled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0