From 448c4546f28433c2d6f617d60cf02aa311839b6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
Date: Wed, 9 Aug 2023 09:57:15 +0200
Subject: [PATCH] Stop setting endDate when fetching GoCardless transactions
 (#1493)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This breaks fetching transactions where the valueDate is in the future.
While the GoCardless documentation says this should never happen, it's
what happens with at least Bank Norwegian due to them using the interest
date as valueDate.  (C.f. #1392)

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
---
 packages/loot-core/src/server/accounts/sync.ts | 3 ---
 upcoming-release-notes/1493.md                 | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)
 create mode 100644 upcoming-release-notes/1493.md

diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts
index f15160a6c..43c8b4ea7 100644
--- a/packages/loot-core/src/server/accounts/sync.ts
+++ b/packages/loot-core/src/server/accounts/sync.ts
@@ -184,8 +184,6 @@ async function downloadGoCardlessTransactions(
   let userToken = await asyncStorage.getItem('user-token');
   if (!userToken) return;
 
-  const endDate = new Date().toISOString().split('T')[0];
-
   const res = await post(
     getServer().GOCARDLESS_SERVER + '/transactions',
     {
@@ -194,7 +192,6 @@ async function downloadGoCardlessTransactions(
       requisitionId: bankId,
       accountId: acctId,
       startDate: since,
-      endDate,
     },
     {
       'X-ACTUAL-TOKEN': userToken,
diff --git a/upcoming-release-notes/1493.md b/upcoming-release-notes/1493.md
new file mode 100644
index 000000000..a1e1dc9a5
--- /dev/null
+++ b/upcoming-release-notes/1493.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [kyrias]
+---
+
+Stop setting `endDate` when fetching GoCardless transactions.
-- 
GitLab