Skip to content

Fixes: Cache strategy for public offline Enketo Forms#1182

Merged
matthew-white merged 1 commit intogetodk:nextfrom
sadiqkhoja:fixes/offline-enketo-public-link
Jul 23, 2025
Merged

Fixes: Cache strategy for public offline Enketo Forms#1182
matthew-white merged 1 commit intogetodk:nextfrom
sadiqkhoja:fixes/offline-enketo-public-link

Conversation

@sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Jul 22, 2025

Removed $ from the enketo cache strategy regex so that enketo offline line works with query parameter suffix as well

Closes forum post

What has been done to verify that this works as intended?

Added a test and manual verification on dev environment.

Why is this the best possible solution? Were any other approaches considered?

Simple solution. I was thinking about using regex with optional query parameters but that would make the regex complex without any benefits.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

No

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No

Before submitting this PR, please make sure you have:

  • branched off and targeted the next branch OR only changed documentation/infrastructure (master is stable and used in production)
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@sadiqkhoja sadiqkhoja changed the base branch from master to next July 22, 2025 15:36
@sadiqkhoja sadiqkhoja force-pushed the fixes/offline-enketo-public-link branch from a90d94b to f0e6a92 Compare July 22, 2025 15:38
Removed $ from the enketo cache strategy regex so that enketo offline line works with query parameter suffix as well
@sadiqkhoja sadiqkhoja force-pushed the fixes/offline-enketo-public-link branch from f0e6a92 to 592ab8e Compare July 22, 2025 15:39
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Thanks! Makes sense to me.

@lognaturel lognaturel added the needs testing Needs manual testing label Jul 22, 2025
@lognaturel
Copy link
Member

lognaturel commented Jul 22, 2025

@getodk/testers once this is merged it would be great to get some testing on staging asap so we can schedule the point release. Thank you!

You can see the bad behavior on the QA server by going to a public access link like https://test.getodk.cloud/f/gOG1T0w7FLSkZLIUcCdLC3okEcBY3dC?st=Hh6JTAbyhFL1D2Yw58dspfdxEtQEuX2NVgC$MwsrP!KvRpofYEGxF95fLo82KkKz and adding /offline at the end of the URL, before the ?st: https://test.getodk.cloud/f/gOG1T0w7FLSkZLIUcCdLC3okEcBY3dC/offline?st=Hh6JTAbyhFL1D2Yw58dspfdxEtQEuX2NVgC$MwsrP!KvRpofYEGxF95fLo82KkKz

Then you need to go offline, refresh, and you'll see that the page doesn't load.

However, if you go back online, remove the ?st part and then go offline again, you should be able to refresh successfully.

Once this PR is on staging, it should be possible to refresh while offline even with public access links. It should also be possible to add other query parameters like defaults: https://forum.getodk.org/t/enketo-public-access-link-with-prefilled-fields/39125/2

@github-project-automation github-project-automation bot moved this to 🕒 backlog in ODK Central Jul 22, 2025
@matthew-white matthew-white moved this from 🕒 backlog to ✏️ in progress in ODK Central Jul 22, 2025
@matthew-white matthew-white linked an issue Jul 22, 2025 that may be closed by this pull request
@matthew-white matthew-white merged commit 689ed14 into getodk:next Jul 23, 2025
9 of 10 checks passed
@srujner
Copy link

srujner commented Jul 23, 2025

@lognaturel
To make sure, it will only work after adding /offline in the URL before ?st ?

Scenario where I have a normal public access link then in Dev Tools I'll switch to offline and refresh the page without adding anything to URL won't work and that is correct behavior?

@srujner
Copy link

srujner commented Jul 23, 2025

@sadiqkhoja @lognaturel
I have finished testing the main part of the issue and everything looks fine.
I haven't had time to look at the other query parameters yet.

If you are in a hurry and the answer to the comment above is yes, you can remove the ‘needs testing’ label. If not, I would check the other parameters tomorrow and then close the PR.

@lognaturel
Copy link
Member

Thanks! Yes, a public access link without the offline URL component should NOT work offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs testing Needs manual testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline Public Access Links don't work

4 participants