Skip to content

fix(smartstore): avoid dev info crash when global store is unavailable - #4186

Merged
sfdctaka merged 1 commit into
forcedotcom:devfrom
sfdctaka:fix-smartstore-dev-info-unavailable
Oct 16, 2026
Merged

sfdctaka merged 1 commit into
forcedotcom:devfrom
sfdctaka:fix-smartstore-dev-info-unavailable

Conversation

@sfdctaka

@sfdctaka sfdctaka commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • This happens when the app is first installed, and then in the login screen, user shakes the simulator to show dev info, select "inspect smart store".
  • Keep the SmartStore developer info rows valid when the default global store cannot open.
  • Display "Unavailable" for missing SQLCipher diagnostics rather than inserting nil into an array literal.
  • Add a regression test for the nil global-store path and preserve the inherited info rows.

Validation

  • SmartStoreSDKManagerTests: 8 passed on an iOS simulator.
  • Full SmartStore suite was not verified in the primary checkout; the attempt timed out.

This changes only the developer info display and does not change database opening or recovery behavior.

@github-actions

Copy link
Copy Markdown
TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all1 ran1 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@github-actions

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SmartStore iOS ^18 Test Results181 ran181 ✅
TestResult
No test annotations available

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.68%. Comparing base (c7d68de) to head (b74f07d).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4186      +/-   ##
==========================================
- Coverage   72.20%   67.68%   -4.52%     
==========================================
  Files         254      254              
  Lines       23169    23169              
==========================================
- Hits        16729    15682    -1047     
- Misses       6440     7487    +1047     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 71.20% <ø> (-0.19%) ⬇️
Core 61.52% <ø> (-6.73%) ⬇️
SmartStore 73.45% <100.00%> (ø)
MobileSync 88.99% <ø> (ø)
Files with missing lines Coverage Δ
...artStore/SmartStore/Classes/SmartStoreSDKManager.m 82.22% <100.00%> (ø)

... and 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +100 to +102
@"SQLCipher version", [store getSQLCipherVersion] ?: @"Unavailable",
@"SQLCipher Compile Options", [[store getCompileOptions] componentsJoinedByString:@", "] ?: @"Unavailable",
@"SQLCipher Runtime Settings", [[store getRuntimeSettings] componentsJoinedByString:@", "] ?: @"Unavailable",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

?: @"Unavailable" prevents a nil SQLCipher value from being inserted into the Dev Info array.

@sfdctaka
sfdctaka requested a review from brandonpage October 15, 2026 23:28
@sfdctaka

Copy link
Copy Markdown
Contributor Author

getDevSupportInfos builds an Objective-C array of alternating labels and values. An @[...] array literal cannot contain nil. When the global SmartStore fails to open, store is nil; sending it getSQLCipherVersion returns nil. That makes the first two array entries effectively:

@[@"SQLCipher version", nil]

Array creation throws the exception in the crash report: attempt to insert nil object from objects[1].

The ?: @"Unavailable" expression replaces that nil before the array is created. The Dev Info UI then receives a valid string value and can show the row instead of crashing. The same protection applies to the next two SQLCipher values. It does not make SmartStore open successfully; it only lets Dev Info remain usable when the store is unavailable.

@sfdctaka
sfdctaka merged commit 4931bd5 into forcedotcom:dev Oct 16, 2026
23 of 24 checks passed
@sfdctaka
sfdctaka deleted the fix-smartstore-dev-info-unavailable branch October 16, 2026 01:13
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