chore: enabling strictNullChecks in back-end sources - #3338
Open
ericleponner wants to merge 38 commits into
Open
chore: enabling strictNullChecks in back-end sources#3338ericleponner wants to merge 38 commits into
ericleponner wants to merge 38 commits into
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3338 +/- ##
==========================================
- Coverage 99.98% 99.92% -0.06%
==========================================
Files 213 213
Lines 6699 6725 +26
Branches 1209 1229 +20
==========================================
+ Hits 6698 6720 +22
- Misses 1 5 +4
🚀 New features to boost your workflow:
|
ericleponner
force-pushed
the
3316_strictnullcheck_in_backend
branch
4 times, most recently
from
August 25, 2026 17:15
e2c1862 to
416d2c2
Compare
ericleponner
marked this pull request as ready for review
August 25, 2026 17:46
ericleponner
force-pushed
the
3316_strictnullcheck_in_backend
branch
from
August 26, 2026 15:20
416d2c2 to
8d9321b
Compare
steven-sheehy
marked this pull request as draft
August 26, 2026 15:24
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 105 out of 105 changed files in this pull request and generated 2 comments.
Suppressed comments (6)
back-end/apps/notifications/src/receiver/receiver.service.ts:1
- transaction.creatorKey
is accessed as non-null, but the function comment says a deleted creator key will not be included (i.e., it can be null/undefined). This can throw at runtime. Use optional chaining (and filter out missing creatorId) or explicitly throw if a creator key is required for this flow, and adjust downstream uses ofcreatorId!` accordingly.
back-end/libs/common/src/transaction-signature/account-cache.service.ts:1 encodedKeyis abytea/Buffer | nullfield, but this code writes[]whenaccountData.keyis null. This will store the wrong type and may fail at runtime or serialize incorrectly. Usenull(orundefinedif you intend to omit updating the column) instead of an empty array.
back-end/libs/common/src/execute/execute.service.ts:1- Using
undefinedin a TypeORM.set()commonly means “do not update this column”. IftransactionStatusCodeisnulland you intend to clearstatusCode, this will leave the previous DB value untouched (stale status code). Prefer settingstatusCodetonullwhen you want to clear it, or build the.set()object conditionally to match the intended semantics.
back-end/apps/api/src/users/users.service.ts:1 - When reactivating a soft-deleted user,
deletedAtshould be explicitly cleared. Setting it toundefinedtypically results in “no update” (keeping the user deleted) depending on howupdateUser()persists. UsedeletedAt: nullto reliably undelete the user (and keep tests aligned with the actual persistence semantics).
back-end/libs/common/src/transaction-signature/transaction-signature.service.ts:1 - New error message is missing punctuation and uses inconsistent quoting, which makes it harder to search/standardize in logs. Consider using a consistent message format (e.g.,
No fee payer account id.) and (optionally) a domain-specific error type if callers need to distinguish configuration/data errors from internal errors.
back-end/apps/api/src/auth/auth.service.ts:125 - Falling back to
''whenOTP_SECRETis not configured can create a predictable OTP secret, which may allow OTP verification to succeed under a misconfiguration. Instead, reject verification when the secret is missing (e.g., throwUnauthorizedExceptionor a configuration error) rather than verifying against an empty secret.
const secret = this.getOtpSecret(user.email) ?? '';
const { valid } = await otplib.verify({
token,
secret,
Comment on lines
296
to
302
| const k = key(item); | ||
| if (!map.has(k)) { | ||
| map.set(k, []); | ||
| if (k) { | ||
| if (!map.has(k)) { | ||
| map.set(k, []); | ||
| } | ||
| map.get(k)!.push(item); | ||
| } |
| case TransactionNodeCollection.HISTORY: { | ||
| statusFilter = statusFilter?.length ? statusFilter : TRANSACTION_STATUS_COLLECTIONS.HISTORY; | ||
| transactionTypeFilter = transactionTypeFilter?.length ? transactionTypeFilter : null; | ||
| transactionTypeFilter = transactionTypeFilter.length ? transactionTypeFilter : []; |
Contributor
Author
There was a problem hiding this comment.
Type of transactionTypeFilter is TransactionType[] : so optional chaining is useless.
ericleponner
force-pushed
the
3316_strictnullcheck_in_backend
branch
5 times, most recently
from
August 28, 2026 18:27
fa41973 to
c81aeba
Compare
ericleponner
marked this pull request as ready for review
August 28, 2026 18:29
ericleponner
marked this pull request as draft
August 28, 2026 19:40
ericleponner
marked this pull request as ready for review
August 31, 2026 12:37
ericleponner
force-pushed
the
3316_strictnullcheck_in_backend
branch
3 times, most recently
from
August 31, 2026 17:01
ee93024 to
7032c49
Compare
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
…rsByTransactionId(). Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
… transactionRepoGroup.findOne() returns null. Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
…ionStatusUpdate(). Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
ericleponner
force-pushed
the
3316_strictnullcheck_in_backend
branch
from
September 1, 2026 10:22
5a6b0d6 to
1e36ef6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Changes below enable
strict-null-checksandstrictBindingCallApplyflags in back-endtsconfig.json.Related issue(s):
Fixes #3316