Skip to content

fix: [SDK-5314] JWT - drop the Identity Verification beta queues and limit cached queue - #1758

Open
nan-li wants to merge 2 commits into
5.8-mainfrom
nan/sdk-5314
Open

nan-li wants to merge 2 commits into
5.8-mainfrom
nan/sdk-5314

Conversation

@nan-li

@nan-li nan-li commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Remove the 5.3.0-beta pending-auth queues at start, cap cached queue reads, and make UserDefaults archiving exception-safe. SDK-5314.

Details

Motivation

Devices upgrading from the 5.3.0-beta line carry five *_PENDING_QUEUE_KEY blobs that this branch never reads, and on affected devices those blobs and the regular queue keys are large. Archiving or writing an oversized queue is what crashes the beta today, and the UserDefaults helper here would crash the same way on an unarchivable or oversized value.

Scope

  • OneSignalUserManagerImpl.start() removes the five beta pending keys before the executors read their caches. Their names return to OneSignalCommonDefines.h as OS_IV_BETA_*.
  • Every cached queue read in the five executors and the operation repo passes a 1 MB cap. A larger blob is removed and logged, not decoded.
  • OneSignalUserDefaults catches exceptions from archiving and unarchiving and drops the key instead of raising into the host app, treats a nil decode like a missing key, and refuses to write a value of 4 MB or more, which CFPreferences rejects and which can stop the suite persisting afterwards.
  • The beta's pending copies are dropped, not migrated. The beta also merged them into the regular queue keys, which this branch reads within the cap.
  • Nothing sent to the server changes.

Testing

Unit testing

Five tests in OneSignalCoreTests cover the cap, a blob within the cap, an unreadable blob, an unarchivable value and a value at the platform limit. One test in OneSignalUserTests seeds all five beta keys plus an oversized update blob, drives start(), and asserts the keys are gone and the queue is empty.

Manual testing

OneSignalCoreTests and OneSignalUserTests run on an iPhone 17 Pro simulator (iOS 26.5); the full test plan was not run. The dev app from this branch installed over 5.3.0-beta-03 state with 8 parked Requests: both beta keys removed at start, no crash, Requests held until a token arrives. Ran on device.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

@nan-li
nan-li marked this pull request as ready for review September 24, 2026 16:36
@nan-li nan-li changed the title fix: [SDK-5314] drop the Identity Verification beta queues and guard cached queue blobs fix: [SDK-5314] drop the Identity Verification beta queues and guard cached queue Sep 24, 2026
@nan-li nan-li changed the title fix: [SDK-5314] drop the Identity Verification beta queues and guard cached queue fix: [SDK-5314] JWT - drop the Identity Verification beta queues and limit cached queue Sep 25, 2026
@nan-li
nan-li requested a review from a team September 25, 2026 16:58
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.

1 participant