[PR #6337] [MERGED] Fix API init() silently ignoring authentication failures #55755

Closed
opened 2026-05-01 03:00:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6337
Author: @MatissJanis
Created: 12/8/2025
Status: Merged
Merged: 12/12/2025
Merged by: @MatissJanis

Base: masterHead: matiss/fix-api-auth-silent-failure


📝 Commits (1)

  • ae0e87d Fix API init() silently ignoring authentication failures

📊 Changes

2 files changed (+11 additions, -1 deletions)

View changed files

📝 packages/loot-core/src/server/main.ts (+4 -1)
upcoming-release-notes/6337.md (+7 -0)

📄 Description

Summary

When using the @actual-app/api package, if authentication failed during init() (e.g., wrong password, network issue), the error was silently ignored. This led to confusing "Could not get remote files" errors later when calling downloadBudget().

Changes

  • Modified init() in packages/loot-core/src/server/main.ts to check the result of the sign-in handler and throw an error if authentication fails

Before

await actual.init({
  serverURL: 'https://example.com',
  password: 'wrong-password',
});
// No error thrown, init() appears to succeed

await actual.downloadBudget('sync-id');
// Error: Could not get remote files (confusing!)

After

await actual.init({
  serverURL: 'https://example.com', 
  password: 'wrong-password',
});
// Error: Authentication failed: invalid-password (clear feedback!)

Maybe fixes #6320


🔄 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/6337 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 12/8/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/fix-api-auth-silent-failure` --- ### 📝 Commits (1) - [`ae0e87d`](https://github.com/actualbudget/actual/commit/ae0e87d5c22496685ce546fd208cdf9d4656f177) Fix API init() silently ignoring authentication failures ### 📊 Changes **2 files changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/main.ts` (+4 -1) ➕ `upcoming-release-notes/6337.md` (+7 -0) </details> ### 📄 Description ## Summary When using the `@actual-app/api` package, if authentication failed during `init()` (e.g., wrong password, network issue), the error was silently ignored. This led to confusing "Could not get remote files" errors later when calling `downloadBudget()`. ## Changes - Modified `init()` in `packages/loot-core/src/server/main.ts` to check the result of the sign-in handler and throw an error if authentication fails ## Before ```javascript await actual.init({ serverURL: 'https://example.com', password: 'wrong-password', }); // No error thrown, init() appears to succeed await actual.downloadBudget('sync-id'); // Error: Could not get remote files (confusing!) ``` ## After ```javascript await actual.init({ serverURL: 'https://example.com', password: 'wrong-password', }); // Error: Authentication failed: invalid-password (clear feedback!) ``` Maybe fixes #6320 --- <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-01 03:00:19 -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#55755