Skip to content

Remove NOT_RESTORED guard#53

Merged
wesdewitte merged 6 commits into
developfrom
feature/invalidate_listeners
Jan 23, 2026
Merged

Remove NOT_RESTORED guard#53
wesdewitte merged 6 commits into
developfrom
feature/invalidate_listeners

Conversation

@jdegger

@jdegger jdegger commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

This change removes the managerRestored guard from getButtons so that it no longer rejects with NOT_RESTORED and instead always returns the current list of buttons once FLICManager is configured. In the old Objective‑C implementation, getButtons simply read FLICManager.sharedManager.buttons (possibly empty) without depending on managerDidRestoreState, which is only invoked during iOS state restoration and not on a fresh launch. By introducing managerRestored as a hard precondition, the new TurboModule implementation caused getButtons to fail with NOT_RESTORED on normal first‑run usage, even though the manager was initialized correctly. Aligning getButtons with the old behavior fixes that regression while still keeping the NOT_INITIALIZED guard and leaving managerDidRestoreState for logging and event emission only.


Note

getButtons no longer requires manager restore; manager state events are more consistent, JS marks initialized on restored; version bumped to beta.19.

  • iOS (ios/Flic2.mm)
    • getButtons: remove managerRestored precondition so it always returns current buttons when manager is configured.
    • Manager events:
      • Emit restored only once and include state/stateName.
      • Always emit stateChanged; also emit restored when powered on if not previously restored.
  • JS (src/index.ts)
    • On managerStateChange with event==='restored', mark manager as initialized.
  • Package
    • Bump version to 2.0.0-beta.19.

Written by Cursor Bugbot for commit e7431b6. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 16, 2025 13:34
@pull-checklist

pull-checklist Bot commented Dec 16, 2025

Copy link
Copy Markdown

Security Checklist

  • Does this code/config include PII, and is it marked correctly in xgac-types?
  • If there's PII, is it properly masked in responses/UI? Can we expose less?
  • Are all secrets (API keys, passwords) securely managed through Terraform in Google Cloud Secrets?
  • Are access controls implemented in this PR without the use of hard coded security measures?
  • If using database lookups, did you avoid unsafeModel queries?
  • Is user input validated and sanitized (SQL, XSS, etc)?
  • Are logging statements free from sensitive data?
  • Are development console logs removed?
  • Is rate limiting/throttling applied if misuse of this feature could be a problem?
  • If this change includes a DB migration, is it backwards compatible and safe to roll out?
  • Can we safely rollback to a version without this change?

Dependency update detected!

  • Is de nieuwe dependency gecheckt op malware?
  • Is de versie zonde ^ gelocked?
  • Installeert deze repo in de CI/CD pipeline alles met npm ci i.p.v. npm install?

@jdegger jdegger requested a review from wesdewitte December 16, 2025 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the managerRestored guard from the getButtons method to fix a regression where the method incorrectly rejected with NOT_RESTORED during normal first-run usage. The change restores compatibility with the original Objective-C implementation by allowing getButtons to return the current button list (even if empty) as soon as FLICManager is configured, without requiring the state restoration callback that only fires in specific iOS scenarios.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread ios/Flic2.mm
Comment thread ios/Flic2.mm
Comment thread ios/Flic2.mm
@wesdewitte wesdewitte merged commit c5f74fd into develop Jan 23, 2026
3 of 4 checks passed
@wesdewitte wesdewitte deleted the feature/invalidate_listeners branch January 23, 2026 14:00
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