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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pwa): file SWR filter & allow navigation 403s [LIBS-356] [LIBS-357] #762

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

KaiVandivier
Copy link
Contributor

@KaiVandivier KaiVandivier commented Oct 21, 2022

Pared down version of #757
Addresses https://dhis2.atlassian.net/browse/TECH-1462 (partially)

  • Switches SWR filter to handle just image files
  • Passes 403 responses to client to show 'unauthorized' when online

Pairs well with dhis2/app-runtime#1268 馃

Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

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

I think this looks good, nice and simple! I'm approving, but let's discuss super quickly what the implications of changing this are, just so we make sure it's super low-risk for 2.39.0

@KaiVandivier
Copy link
Contributor Author

KaiVandivier commented Oct 24, 2022

Summary of in-person discussion:

We'll go with this minimal fix instead of PR #757 (which includes some client-side changes) with the intention of keeping it simple for 2.39.0. This simpler version will address unauthorized users from viewing pwa apps while online, but there will still be some obscure situations where an unauthorized user can see a pwa app while offline. It will only work when deployed on production instances; apps deployed as standalone on netlify or elsewhere won't return the 403.

The SWR changes will fix some issues that we saw by only handling images; the performance benefit that we want is really only on images anyway. Caching .action or .json requests could be problematic or sensitive.

dhis2/app-runtime#1268 will also help avoid issues with the SWR strategy showing requests belonging to another user.

@KaiVandivier KaiVandivier merged commit bbfd3eb into master Oct 24, 2022
@KaiVandivier KaiVandivier deleted the fix-pwa-403s-and-swr branch October 24, 2022 12:57
dhis2-bot added a commit that referenced this pull request Oct 24, 2022
## [10.1.2](v10.1.1...v10.1.2) (2022-10-24)

### Bug Fixes

* **pwa:** file SWR filter & allow navigation 403s [LIBS-356] [LIBS-357] ([#762](#762)) ([bbfd3eb](bbfd3eb))
@dhis2-bot
Copy link
Contributor

馃帀 This PR is included in version 10.1.2 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

dhis2-bot added a commit that referenced this pull request Nov 15, 2022
# [10.2.0-alpha.2](v10.2.0-alpha.1...v10.2.0-alpha.2) (2022-11-15)

### Bug Fixes

* **deps:** bump app-runtime to 3.6.1 [LIBS-356] ([#763](#763)) ([190b9e7](190b9e7))
* **deps:** update app-runtime and ui packages ([#761](#761)) ([f6406c5](f6406c5))
* **offline-interface:** protect against SW errors ([ad3e476](ad3e476))
* **pwa:** file SWR filter & allow navigation 403s [LIBS-356] [LIBS-357] ([#762](#762)) ([bbfd3eb](bbfd3eb))
* **pwa-boundary:** catch errors ([ecd8b21](ecd8b21))
@dhis2-bot
Copy link
Contributor

馃帀 This PR is included in version 10.2.0-alpha.2 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

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

Successfully merging this pull request may close these issues.

None yet

3 participants