[PR #7148] [CLOSED] [WIP] Check null contentType before parsing JSON response #60621

Closed
opened 2026-05-07 02:44:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7148
Author: @bennyen
Created: 3/7/2026
Status: Closed

Base: masterHead: patch-1


📝 Commits (2)

  • 814f7bb Check null contentType before parsing JSON response
  • 08e8f28 [autofix.ci] apply automated fixes

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 packages/loot-core/src/server/post.ts (+4 -1)

📄 Description

Description

I am experiencing #7133 and while debugging, I came across the following error. It appears that the following throw method ends up throwing NPE.

[Exception] TypeError: can't access property "toLowerCase", res.headers.get(...) is null
    throwIfNot200 post.ts:14
    resBuffer post.ts:212
    _fullSync index.ts:697
    fullSync index.ts:581
    fullSync async.ts:68
    backend app.ts:20
    runHandler mutators.ts:67
    initApp index.ts:58
    initApp index.ts:38
    initApp main.ts:216
    async* browser-server.Bww9SuVi.js:84
    async* browser-server.Bww9SuVi.js:57
index.ts:26:13

Testing

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.89 MB 0%
loot-core 1 5.82 MB → 5.82 MB (+15 B) +0.00%
api 1 4.43 MB → 4.43 MB (+15 B) +0.00%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.89 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 9.54 MB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/ca.js 187.93 kB 0%
static/js/da.js 106.2 kB 0%
static/js/de.js 179.89 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 170.42 kB 0%
static/js/es.js 174.37 kB 0%
static/js/fr.js 179.41 kB 0%
static/js/it.js 170.98 kB 0%
static/js/nb-NO.js 156.8 kB 0%
static/js/nl.js 113.06 kB 0%
static/js/pl.js 89.33 kB 0%
static/js/pt-BR.js 182.89 kB 0%
static/js/th.js 181.58 kB 0%
static/js/uk.js 214.65 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.16 MB 0%
static/js/narrow.js 638.11 kB 0%
static/js/TransactionList.js 106.22 kB 0%
static/js/wide.js 164.15 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.04 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.82 MB → 5.82 MB (+15 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/post.ts 📈 +15 B (+0.30%) 4.84 kB → 4.86 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.CQQdN_6H.js 0 B → 5.82 MB (+5.82 MB) -

Removed

Asset File Size % Changed
kcab.worker.MNtpiHkH.js 5.82 MB → 0 B (-5.82 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.43 MB → 4.43 MB (+15 B) +0.00%
Changeset
File Δ Size
src/server/post.ts 📈 +15 B (+0.35%) 4.23 kB → 4.24 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
bundle.api.js 4.43 MB → 4.43 MB (+15 B) +0.00%

Smaller
No assets were smaller

Unchanged
No assets were unchanged


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/7148 **Author:** [@bennyen](https://github.com/bennyen) **Created:** 3/7/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (2) - [`814f7bb`](https://github.com/actualbudget/actual/commit/814f7bb2aafd2d76ce0fa9c6dde6caea9bcfc4bb) Check null contentType before parsing JSON response - [`08e8f28`](https://github.com/actualbudget/actual/commit/08e8f287bdc590b7a8490e934f599e18b40ec10c) [autofix.ci] apply automated fixes ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/post.ts` (+4 -1) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ## Description I am experiencing #7133 and while debugging, I came across the following error. It appears that the following throw method ends up throwing NPE. ``` [Exception] TypeError: can't access property "toLowerCase", res.headers.get(...) is null throwIfNot200 post.ts:14 resBuffer post.ts:212 _fullSync index.ts:697 fullSync index.ts:581 fullSync async.ts:68 backend app.ts:20 runHandler mutators.ts:67 initApp index.ts:58 initApp index.ts:38 initApp main.ts:216 async* browser-server.Bww9SuVi.js:84 async* browser-server.Bww9SuVi.js:57 index.ts:26:13 ``` ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> ## Checklist - [ ] Release notes added (see link above) - [ ] No obvious regressions in affected areas - [ ] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.89 MB | 0% loot-core | 1 | 5.82 MB → 5.82 MB (+15 B) | +0.00% api | 1 | 4.43 MB → 4.43 MB (+15 B) | +0.00% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.89 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.54 MB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/ca.js | 187.93 kB | 0% static/js/da.js | 106.2 kB | 0% static/js/de.js | 179.89 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 170.42 kB | 0% static/js/es.js | 174.37 kB | 0% static/js/fr.js | 179.41 kB | 0% static/js/it.js | 170.98 kB | 0% static/js/nb-NO.js | 156.8 kB | 0% static/js/nl.js | 113.06 kB | 0% static/js/pl.js | 89.33 kB | 0% static/js/pt-BR.js | 182.89 kB | 0% static/js/th.js | 181.58 kB | 0% static/js/uk.js | 214.65 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.16 MB | 0% static/js/narrow.js | 638.11 kB | 0% static/js/TransactionList.js | 106.22 kB | 0% static/js/wide.js | 164.15 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.04 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.82 MB → 5.82 MB (+15 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/post.ts` | 📈 +15 B (+0.30%) | 4.84 kB → 4.86 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CQQdN_6H.js | 0 B → 5.82 MB (+5.82 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.MNtpiHkH.js | 5.82 MB → 0 B (-5.82 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.43 MB → 4.43 MB (+15 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/post.ts` | 📈 +15 B (+0.35%) | 4.23 kB → 4.24 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.43 MB → 4.43 MB (+15 B) | +0.00% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-07 02:44:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#60621