Skip to content
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(v2): enable refetch on mount for storage responses #4821

Merged
merged 4 commits into from
Sep 8, 2022

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Sep 8, 2022

Problem

Storage responses was not refetching until the admin refreshed the page. But once they refresh the page, they need to upload their secret key again, creating higher friction for admins to see their updated form responses.

Closes #4737

Solution

Remove custom refetch settings.

Also made some changes to the storage responses page for mobile responsiveness.

Breaking Changes

  • No - this PR is backwards compatible

Screenshots

Screen.Recording.2022-09-08.at.5.07.28.PM.mov

@justynoh
Copy link
Contributor Author

justynoh commented Sep 8, 2022

staleTime
Frankly, I picked 10s just as an order of estimation, but maybe setting staleTime isn't even the right approach at all - pls give me comments if so! 🙏 I took reference from the (soon-to-be-removed-removed-removed-REMOVED) "your submission may fail" query which doesn't even set the staleTime, so it always refetches haha. I didn't think refetching every time was necessary for this use but we can always just refetch always.

As for why 10s, we can look at some logs for reference. Not sure if this is super useful but also i figured i can just look at it to brush up on my cloudwatch syntax anyway ¯_(ツ)_/¯

Ran these queries at 11:07am on a Thursday over 3 hours, thus capturing logs from 8-11am on a weekday (our busiest traffic period).

image

The highest form got 980 submissions over 3h, which amounts to about 980/(3*60) = 5.44 submissions per minute, on average, so 10s is more than sufficient to update fast enough.

Looking from the admin perspective, we can find how many admins are interested in their storage submission metadata. In the same time period we can look at what's the first and last request for each form (duration is the time between the first and last request), and how many requests they made within that time period.

image

The maximum number of requests made was 293 in 3 hours, but that was within the span of about an hour. The remainder all made less than 100 requests. The duration was varying, though. This is very coarse-grained data, if we really want to know, we can look deeper into those who seemed to be "online" for a long time (e.g. for almost the whole 3h period) to determine what their usage patterns are.

@justynoh justynoh marked this pull request as ready for review September 8, 2022 03:38
@justynoh justynoh assigned wanlingt and unassigned wanlingt Sep 8, 2022
@justynoh justynoh requested a review from wanlingt September 8, 2022 03:39
@justynoh justynoh requested a review from karrui September 8, 2022 05:14
@karrui
Copy link
Contributor

karrui commented Sep 8, 2022

should we also update the PR description?

@justynoh justynoh merged commit f185464 into form-v2/develop Sep 8, 2022
@justynoh justynoh deleted the form-v2/feat/refresh-storage-responses branch September 8, 2022 12:18
@justynoh justynoh mentioned this pull request Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants