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

When rule is set to .critical, previous skipped version setting should be ignored #402

Closed
aburgel opened this issue Aug 11, 2022 · 4 comments · Fixed by #405
Closed

When rule is set to .critical, previous skipped version setting should be ignored #402

aburgel opened this issue Aug 11, 2022 · 4 comments · Fixed by #405

Comments

@aburgel
Copy link
Contributor

aburgel commented Aug 11, 2022

We use Siren to force users to upgrade when we release breaking changes on our backend. We ran into an issue recently related to this and the StoredSkippedVersion setting.

Our process is this:

  1. Ship a new version (say 1.5.0)
  2. Wait a few days
  3. Update an endpoint that defines a minimum required version (in this example, we set it to '1.5.0')

When our app starts up, we hit this endpoint, and if current version < minimum required version, we set siren to use Rules.critical.

The problem arises in step 2. We wait a few days so we can let users upgrade automatically, but it's possible that during this time they're are presented with the Siren option to skip the upgrade (since at this point, we're using Rules.default). Because the user may have skipped, when we set Rules.critical, the upgrade won't get enforced.

I think when Rules.critical is in use (or more specifically AlertType.force) StoredSkippedVersion should be ignored.

@ArtSabintsev
Copy link
Owner

ArtSabintsev commented Aug 12, 2022

Man oh man - are you the same Alex from Swaag? It's been a long time.

I need to think through this problem and I will get back to you later tonight

@ArtSabintsev
Copy link
Owner

Yup, just tested this out in the sample app by running the following functions in AppDelegate

  1. defaultExample()
  2. hyperCriticalExample()

When I ran 1, clicked Skip, closed the process. Relaunched the app with 2, it didn't pop the modal.

This is totally a bug that's been in the code for 7.5 years that I've never come across personally.

Feel free to open a PR at your leisure. I'll be out of pocket for about a week, but will check back when I'm back if you do end up opening a PR.

@aburgel
Copy link
Contributor Author

aburgel commented Sep 18, 2022

@ArtSabintsev Yep, that's me. Can't believe you remember that far back 😄 It's nice to see all the iOS projects you have. This one has been especially useful. I just opened up a small PR with a fix for this issue.

@ArtSabintsev
Copy link
Owner

Thank you! Closing this one in favor of that one.

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

Successfully merging a pull request may close this issue.

2 participants