📌 Description
tsconfig.json may not have "strictNullChecks": true explicitly set (or it may be off under a loose strict mode). Enabling strict null checks across the codebase will surface places where string | null values from the wallet context, stream records, or config are used without null guards, preventing runtime errors from reaching users.
💡 Why it matters: Null-pointer-style errors are the most common runtime crash category; strict null checks move them to compile time.
🧩 Requirements and context
- Confirm current
tsconfig.json settings; if strict: true already implies strictNullChecks, investigate and resolve all existing tsc --noEmit type errors instead.
- Fix null-guard issues in
src/pages/Recipient.tsx (wallet address can be null), src/lib/stellar/tx.ts (config rpcUrl can be null), and src/lib/api/streamsService.ts.
- Add
"noUncheckedIndexedAccess": true to catch unchecked array access in filter/sort chains in src/pages/Streams.tsx.
- Run
tsc --noEmit in CI and fail if there are errors.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b refactor/strict-null-checks
2. Implement changes
- Write/modify the relevant source:
tsconfig.json, src/pages/Recipient.tsx, src/lib/stellar/tx.ts, src/lib/api/streamsService.ts
- Write comprehensive tests:
npm run build (tsc) is the test
- Add documentation: comment in
tsconfig.json explaining each enabled flag
- Validate security assumptions: null dereferences in wallet address paths could silently use empty strings; guards must reject empty strings too
3. Test and commit
- Cover edge cases:
wallet.address used in template literals when null, array index access after filter()
- Include test output and security notes in the PR description.
Example commit message
refactor(types): enable strictNullChecks and noUncheckedIndexedAccess, fix resulting errors
✅ Acceptance criteria
🔒 Security notes
Empty string walletAddress passed to Stellar SDK functions returns unhelpful errors; strict null checks will surface and force explicit guards.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
tsconfig.jsonmay not have"strictNullChecks": trueexplicitly set (or it may be off under a loosestrictmode). Enabling strict null checks across the codebase will surface places wherestring | nullvalues from the wallet context, stream records, or config are used without null guards, preventing runtime errors from reaching users.🧩 Requirements and context
tsconfig.jsonsettings; ifstrict: truealready impliesstrictNullChecks, investigate and resolve all existingtsc --noEmittype errors instead.src/pages/Recipient.tsx(walletaddresscan benull),src/lib/stellar/tx.ts(configrpcUrlcan benull), andsrc/lib/api/streamsService.ts."noUncheckedIndexedAccess": trueto catch unchecked array access in filter/sort chains insrc/pages/Streams.tsx.tsc --noEmitin CI and fail if there are errors.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
tsconfig.json,src/pages/Recipient.tsx,src/lib/stellar/tx.ts,src/lib/api/streamsService.tsnpm run build(tsc) is the testtsconfig.jsonexplaining each enabled flag3. Test and commit
wallet.addressused in template literals when null, array index access afterfilter()Example commit message
✅ Acceptance criteria
tsc --noEmitpasses with zero errors after changesstrictNullChecks: trueis explicitly set intsconfig.jsonRecipient.tsxandWalletcontext.tsxconfig.rpcUrlnull check is present before RPC calls intx.tstsc --noEmitand fails on errors🔒 Security notes
Empty string walletAddress passed to Stellar SDK functions returns unhelpful errors; strict null checks will surface and force explicit guards.
📋 Guidelines