Skip to content

fix(ios): match CodeGen nullability on webAuth token exchange params - #1741

Merged
subhankarmaiti merged 1 commit into
masterfrom
fix/ios-token-exchange-nullability
Nov 13, 2026
Merged

subhankarmaiti merged 1 commit into
masterfrom
fix/ios-token-exchange-nullability

Conversation

@subhankarmaiti

@subhankarmaiti subhankarmaiti commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Changes

iOS no longer compiles on master. #1737 declared tokenExchangeMaxRetries and tokenExchangeRetryDelay in ios/A0Auth0.mm as (NSNumber * _Nullable), but CodeGen generates them as plain (NSNumber *), which is nonnull because the generated header is in an assume-nonnull region. Clang rejects the mismatch:

A0Auth0.mm:158:47: error: nullability specifier '_Nullable' conflicts with existing specifier 'nonnull'
A0Auth0.mm:159:47: error: nullability specifier '_Nullable' conflicts with existing specifier 'nonnull'

This changes both parameters to (NSNumber *) so they match the generated protocol and the style of the other params in the file ((NSString *)scheme). I avoided nonnull on purpose: JS passes undefined for both by default, and nonnull could reject that on the old architecture.

-tokenExchangeMaxRetries:(NSNumber * _Nullable)tokenExchangeMaxRetries
-tokenExchangeRetryDelay:(NSNumber * _Nullable)tokenExchangeRetryDelay
+tokenExchangeMaxRetries:(NSNumber *)tokenExchangeMaxRetries
+tokenExchangeRetryDelay:(NSNumber *)tokenExchangeRetryDelay

No public API or TypeScript change. The iOS bridge still accepts and ignores both options, as it does today. Android is unaffected.

Reverting is a plain revert of two lines, but until this or an equivalent fix lands, iOS builds fail on master, so it should go in before the next release.

References

Testing

xcodebuild Debug build of the example app for the iOS simulator (iPhone 18 Pro, iOS 27.2, Xcode 27):

  • Before: fails with the two errors above.
  • After: builds, and A0Auth0.o and the app binary are rebuilt.

I did not run webAuth on iOS with this build, and yarn test is unaffected since no TypeScript changed.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@subhankarmaiti
subhankarmaiti requested a review from a team as a code owner November 13, 2026 11:21
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • API Changes
    • The iOS authentication API now marks token-exchange retry count and delay options as non-nullable. Integrations using this API should pass values for both options; the change updates their declared nullability.

The webAuth method now declares tokenExchangeMaxRetries and tokenExchangeRetryDelay as nonnull NSNumber * parameters.

Changes: WebAuth nullability

Layer / File(s) Summary
Update token exchange parameter nullability
ios/A0Auth0.mm
The webAuth signature changes tokenExchangeMaxRetries and tokenExchangeRetryDelay from nullable to nonnull NSNumber * parameters.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: utkrishtsahu, nandanprabhu

Merge Risk: Minimal · up to 81017

This change fixes iOS build errors caused by mismatched nullability and does not alter runtime behavior or the public API. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: iOS webAuth token exchange params now match CodeGen nullability. The raw summary confirms the change to tokenExchangeMaxRetries and tokenExchangeRetryDelay in ios/A0Auth0.m…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is specific and related to the changeset. It explains that the iOS build fails on master because tokenExchangeMaxRetries and tokenExchangeRetryDelay were declared as nullable in ios/A0…
Full details: Title check

Explanation

The title names the change: iOS webAuth token exchange params now match CodeGen nullability. The raw summary confirms the change to tokenExchangeMaxRetries and tokenExchangeRetryDelay in ios/A0Auth0.mm from nullable to nonnull NSNumber pointers. The title is specific and fits the single-file, two-line diff. Note the summary calls the change nonnull, while the description says it changes to plain (NSNumber *), which is nonnull under assume-nonnull; this does not affect the title's accuracy.

Full details: Description check

Explanation

The description is specific and related to the changeset. It explains that the iOS build fails on master because tokenExchangeMaxRetries and tokenExchangeRetryDelay were declared as nullable in ios/A0Auth0.mm, while CodeGen generates them as nonnull. It gives the Clang error text, the two-line diff that changes them to (NSNumber *), the reason nonnull was avoided, and the build test performed. This matches the raw summary, which records the same two-line nullability change in ios/A0Auth0.mm.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3045420 and 81017e9.

Files selected for processing: 1

  • ios/A0Auth0.mm

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@subhankarmaiti
subhankarmaiti merged commit 705bffa into master Nov 13, 2026
6 checks passed
@subhankarmaiti
subhankarmaiti deleted the fix/ios-token-exchange-nullability branch November 13, 2026 11:24
@subhankarmaiti subhankarmaiti mentioned this pull request Nov 13, 2026
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.

2 participants