Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleted transaction keeps getting reimported (saltedge) #8828

Closed
4 tasks done
ypsilonkah opened this issue Apr 26, 2024 · 13 comments
Closed
4 tasks done

deleted transaction keeps getting reimported (saltedge) #8828

ypsilonkah opened this issue Apr 26, 2024 · 13 comments

Comments

@ypsilonkah
Copy link

ypsilonkah commented Apr 26, 2024

Support guidelines

I've found a bug and checked that ...

Description

I have set up an saltedge import that runs twice a day and grabs the last 7 days of transactions. I encounter a problem that a transaction is reimported although I have deleted it beforehand. As I understand it, importing skips duplicates even if they are deleted (https://docs.firefly-iii.org/how-to/data-importer/import/duplicates/) -- so I wonder, why the single transaction keeps appearing after the import is triggered?

Debug information

{
  "id": 896,
  "created_at": "2024-04-26T14:00:06.000000Z",
  "updated_at": "2024-04-26T14:00:07.000000Z",
  "deleted_at": null,
  "user_id": 1,
  "user_group_id": 1,
  "title": null,
  "transaction_journals": [
    {
      "id": 896,
      "created_at": "2024-04-26T14:00:06.000000Z",
      "updated_at": "2024-04-26T14:00:06.000000Z",
      "deleted_at": null,
      "user_id": 1,
      "user_group_id": 1,
      "transaction_type_id": 1,
      "transaction_group_id": 896,
      "bill_id": null,
      "transaction_currency_id": 1,
      "description": "WaschmaschineDATUM 22.04.2024, 15.28 UHR ONLINE-UEBERWEISUNG",
      "date": "2024-04-21T22:00:00.000000Z",
      "interest_date": null,
      "book_date": null,
      "process_date": null,
      "order": 0,
      "tag_count": 0,
      "completed": true,
      "transactions": [
        {
          "id": 1791,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "deleted_at": null,
          "reconciled": false,
          "account_id": 72,
          "transaction_journal_id": 896,
          "description": null,
          "transaction_currency_id": 1,
          "amount": "-710.000000000000",
          "foreign_amount": "",
          "foreign_currency_id": null,
          "identifier": 0,
          "account": {
            "id": 72,
            "created_at": "2024-04-04T18:59:35.000000Z",
            "updated_at": "2024-04-16T06:56:50.000000Z",
            "deleted_at": null,
            "user_id": 1,
            "user_group_id": 1,
            "account_type_id": 3,
            "name": "DKB Tagesgeld",
            "virtual_balance": "0.000000000000",
            "iban": "redacted",
            "active": true,
            "order": 7
          },
          "budgets": [],
          "categories": []
        },
        {
          "id": 1792,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "deleted_at": null,
          "reconciled": false,
          "account_id": 34,
          "transaction_journal_id": 896,
          "description": null,
          "transaction_currency_id": 1,
          "amount": "710.000000000000",
          "foreign_amount": "",
          "foreign_currency_id": null,
          "identifier": 0,
          "account": {
            "id": 34,
            "created_at": "2024-04-04T17:00:53.000000Z",
            "updated_at": "2024-04-04T17:00:53.000000Z",
            "deleted_at": null,
            "user_id": 1,
            "user_group_id": 1,
            "account_type_id": 4,
            "name": "redacted",
            "virtual_balance": "",
            "iban": "redacted",
            "active": true,
            "order": 0
          },
          "budgets": [],
          "categories": []
        }
      ],
      "meta": [
        {
          "id": 3496,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "transaction_journal_id": 896,
          "name": "book_date",
          "data": "2024-04-22 00:00:00",
          "hash": "96ad817c366bdcc1267f5159a2ef0b67f3257bdf89b2e1477916a779d046ab11",
          "deleted_at": null
        },
        {
          "id": 3497,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "transaction_journal_id": 896,
          "name": "import_hash_v2",
          "data": "afbf1b7cb73f9ac7f59410d049defb537e17d35712901a0f6b686fe19db71d5c",
          "hash": "c8d372ab01a2aa66b372c01bf5780803360b7731a8c6c4244ed2ea8a58e7299a",
          "deleted_at": null
        },
        {
          "id": 3498,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "transaction_journal_id": 896,
          "name": "external_id",
          "data": "1260432271169559149",
          "hash": "4deafb85bc25d7d180add78206d3d514299e1e47b0431dfbd790ecf62c9976ac",
          "deleted_at": null
        },
        {
          "id": 3499,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "transaction_journal_id": 896,
          "name": "original_source",
          "data": "ff3-v6.1.15|api-v2.0.14",
          "hash": "cfc9ea0f9e1cf48b02009221438c0643e00749bab22e175a660db0bffd892066",
          "deleted_at": null
        }
      ],
      "tags": [
        {
          "id": 70,
          "created_at": "2024-04-26T14:00:07.000000Z",
          "updated_at": "2024-04-26T14:00:07.000000Z",
          "deleted_at": null,
          "user_id": 1,
          "user_group_id": 1,
          "tag": "Data Import on 2024-04-26 @ 16:00",
          "tagMode": "nothing",
          "date": "2024-04-25T22:00:00.000000Z",
          "description": "",
          "pivot": {
            "transaction_journal_id": 896,
            "tag_id": 70
          }
        }
      ],
      "categories": [
        {
          "id": 38,
          "created_at": "2024-04-12T08:23:08.000000Z",
          "updated_at": "2024-04-12T08:23:08.000000Z",
          "deleted_at": null,
          "user_id": 1,
          "user_group_id": 1,
          "name": "refund",
          "pivot": {
            "transaction_journal_id": 896,
            "category_id": 38
          }
        }
      ],
      "budgets": [],
      "notes": [
        {
          "id": 857,
          "created_at": "2024-04-26T14:00:06.000000Z",
          "updated_at": "2024-04-26T14:00:06.000000Z",
          "deleted_at": null,
          "noteable_id": 896,
          "noteable_type": "FireflyIII\\Models\\TransactionJournal",
          "title": null,
          "text": "SVWZ+WaschmaschineDATUM 22.04.2024, 15.28 UHR ONLINE-UEBERWEISUNG"
        }
      ],
      "locations": [],
      "attachments": [],
      "links": [],
      "piggy_bank_events": []
    }
  ]
}
@JC5
Copy link
Member

JC5 commented Apr 27, 2024

Sorry could you be a little more clear on the two duplicated transactions I see here? This is unreadable. Use the code tag in GitHub, please.

@ypsilonkah
Copy link
Author

Sorry, I was somewhat confused, because the debug field stated that backticks or quotation mark should not be used. I reformatted the debug output of the respective transaction.

@JC5
Copy link
Member

JC5 commented Apr 27, 2024

Yeah that only applies to the debug table.

But do you have an example of the second transaction?

@ypsilonkah
Copy link
Author

ypsilonkah commented Apr 28, 2024

Hi,
so I deleted the transaction again and after triggering an import, it reappears with a different id.

{
  "id": 898,
  "created_at": "2024-04-28T13:55:26.000000Z",
  "updated_at": "2024-04-28T13:55:27.000000Z",
  "deleted_at": null,
  "user_id": 1,
  "user_group_id": 1,
  "title": null,
  "transaction_journals": [
    {
      "id": 898,
      "created_at": "2024-04-28T13:55:25.000000Z",
      "updated_at": "2024-04-28T13:55:26.000000Z",
      "deleted_at": null,
      "user_id": 1,
      "user_group_id": 1,
      "transaction_type_id": 1,
      "transaction_group_id": 898,
      "bill_id": null,
      "transaction_currency_id": 1,
      "description": "WaschmaschineDATUM 22.04.2024, 15.28 UHR ONLINE-UEBERWEISUNG",
      "date": "2024-04-21T22:00:00.000000Z",
      "interest_date": null,
      "book_date": null,
      "process_date": null,
      "order": 0,
      "tag_count": 0,
      "completed": true,
      "transactions": [
        {
          "id": 1795,
          "created_at": "2024-04-28T13:55:25.000000Z",
          "updated_at": "2024-04-28T13:55:25.000000Z",
          "deleted_at": null,
          "reconciled": false,
          "account_id": 72,
          "transaction_journal_id": 898,
          "description": null,
          "transaction_currency_id": 1,
          "amount": "-710.000000000000",
          "foreign_amount": "",
          "foreign_currency_id": null,
          "identifier": 0,
          "account": {
            "id": 72,
            "created_at": "2024-04-04T18:59:35.000000Z",
            "updated_at": "2024-04-16T06:56:50.000000Z",
            "deleted_at": null,
            "user_id": 1,
            "user_group_id": 1,
            "account_type_id": 3,
            "name": "DKB Tagesgeld",
            "virtual_balance": "0.000000000000",
            "iban": "redacted",
            "active": true,
            "order": 7
          },
          "budgets": [],
          "categories": []
        },
        {
          "id": 1796,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "deleted_at": null,
          "reconciled": false,
          "account_id": 34,
          "transaction_journal_id": 898,
          "description": null,
          "transaction_currency_id": 1,
          "amount": "710.000000000000",
          "foreign_amount": "",
          "foreign_currency_id": null,
          "identifier": 0,
          "account": {
            "id": 34,
            "created_at": "2024-04-04T17:00:53.000000Z",
            "updated_at": "2024-04-04T17:00:53.000000Z",
            "deleted_at": null,
            "user_id": 1,
            "user_group_id": 1,
            "account_type_id": 4,
            "name": "redacted",
            "virtual_balance": "",
            "iban": "redacted",
            "active": true,
            "order": 0
          },
          "budgets": [],
          "categories": []
        }
      ],
      "meta": [
        {
          "id": 3504,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "transaction_journal_id": 898,
          "name": "book_date",
          "data": "2024-04-22 00:00:00",
          "hash": "96ad817c366bdcc1267f5159a2ef0b67f3257bdf89b2e1477916a779d046ab11",
          "deleted_at": null
        },
        {
          "id": 3505,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "transaction_journal_id": 898,
          "name": "import_hash_v2",
          "data": "afbf1b7cb73f9ac7f59410d049defb537e17d35712901a0f6b686fe19db71d5c",
          "hash": "c8d372ab01a2aa66b372c01bf5780803360b7731a8c6c4244ed2ea8a58e7299a",
          "deleted_at": null
        },
        {
          "id": 3506,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "transaction_journal_id": 898,
          "name": "external_id",
          "data": "1260432271169559149",
          "hash": "4deafb85bc25d7d180add78206d3d514299e1e47b0431dfbd790ecf62c9976ac",
          "deleted_at": null
        },
        {
          "id": 3507,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "transaction_journal_id": 898,
          "name": "original_source",
          "data": "ff3-v6.1.15|api-v2.0.14",
          "hash": "cfc9ea0f9e1cf48b02009221438c0643e00749bab22e175a660db0bffd892066",
          "deleted_at": null
        }
      ],
      "tags": [
        {
          "id": 71,
          "created_at": "2024-04-28T13:55:12.000000Z",
          "updated_at": "2024-04-28T13:55:12.000000Z",
          "deleted_at": null,
          "user_id": 1,
          "user_group_id": 1,
          "tag": "Data Import on 2024-04-28 @ 15:55",
          "tagMode": "nothing",
          "date": "2024-04-27T22:00:00.000000Z",
          "description": "",
          "pivot": {
            "transaction_journal_id": 898,
            "tag_id": 71
          }
        }
      ],
      "categories": [
        {
          "id": 38,
          "created_at": "2024-04-12T08:23:08.000000Z",
          "updated_at": "2024-04-12T08:23:08.000000Z",
          "deleted_at": null,
          "user_id": 1,
          "user_group_id": 1,
          "name": "refund",
          "pivot": {
            "transaction_journal_id": 898,
            "category_id": 38
          }
        }
      ],
      "budgets": [],
      "notes": [
        {
          "id": 859,
          "created_at": "2024-04-28T13:55:26.000000Z",
          "updated_at": "2024-04-28T13:55:26.000000Z",
          "deleted_at": null,
          "noteable_id": 898,
          "noteable_type": "FireflyIII\\Models\\TransactionJournal",
          "title": null,
          "text": "SVWZ+WaschmaschineDATUM 22.04.2024, 15.28 UHR ONLINE-UEBERWEISUNG"
        }
      ],
      "locations": [],
      "attachments": [],
      "links": [],
      "piggy_bank_events": []
    }
  ]
}

@JC5
Copy link
Member

JC5 commented Apr 28, 2024

I see what you mean. Are you purging transactions in between runs, or do you have different import settings? I mean, it's possible to simply disabling duplicate detection.

@ypsilonkah
Copy link
Author

ypsilonkah commented Apr 29, 2024

I do not purge inbetween the imports (you do refer to purging as the following?):

"The Data Importer will also check deleted transactions when checking for duplicates. This is on purpose! If your import contains bad transactions or informative message hidden as transactions, they will not be re-imported after you've deleted them. If you're sure you wish to reimport transactions, press the Purge button on the last tab of your Profile (under /profile)." (https://docs.firefly-iii.org/how-to/data-importer/import/duplicates/)

The import settings remain the same and the import is triggered as a cron job (monday to friday ever 4 hours from 8am to 6pm). I could of course circumvent this by setting the import range to 1 day and trigger the import once a day. Then, transactions won't get imported after their booking date. This might be a work-around.

However, I understood the documentation that deleted transactions are included in duplicate checking so that they are not imported again (which is reasonable, if you decide to delete it in the first place).

Can you explain, how disabling duplicate detection might help? As I see it, it is exactly what I do want: duplicate detection that recognizes the transaction (even when it is deleted) so it is not imported.

Thanks a lot for your time and effort!

@JC5
Copy link
Member

JC5 commented Apr 29, 2024

Could you share the import configuration you're using right now?

@ypsilonkah
Copy link
Author

Sure. This is the import file (json), that triggers the import.

{
    "version": 3,
    "source": "ff3-importer-1.4.5",
    "created_at": "2024-04-16T08:21:24+02:00",
    "date": "",
    "default_account": 1,
    "delimiter": "comma",
    "headers": false,
    "rules": true,
    "skip_form": false,
    "add_import_tag": true,
    "roles": [],
    "do_mapping": [],
    "mapping": [],
    "duplicate_detection_method": "cell",
    "ignore_duplicate_lines": false,
    "unique_column_index": 0,
    "unique_column_type": "external-id",
    "flow": "spectre",
    "content_type": "csv",
    "custom_tag": "",
    "identifier": "(redacted)",
    "connection": "(redacted)",
    "ignore_spectre_categories": true,
    "grouped_transaction_handling": "",
    "use_entire_opposing_address": false,
    "map_all_data": false,
    "accounts": {
        "acc1(redacted)": 71,
        "acc2(redacted)": 72
    },
    "date_range": "partial",
    "date_range_number": 10,
    "date_range_unit": "d",
    "date_not_before": "2024-04-06",
    "date_not_after": "",
    "nordigen_country": "",
    "nordigen_bank": "",
    "nordigen_requisitions": [],
    "nordigen_max_days": "90",
    "conversion": false,
    "ignore_duplicate_transactions": false
}

@ypsilonkah
Copy link
Author

Ok, I think I see the problem now.
In the import file the last line: "ignore_duplicate_transactions": false --- changed to true, and the deleted transaction is omitted when triggering the import.

@JC5
Copy link
Member

JC5 commented Apr 29, 2024

Ah nice! That was the problem! I am not sure if I put it on "false" (through a bug in the data importer) or if you did. I shall do some research.

But this seems to be solved, so I'll close this if that's OK for you.

@ypsilonkah
Copy link
Author

I just created a new import file from the importer. It is set on "true". I guess it was my change then. :) So please close the issue and thanks for your time again.

@JC5
Copy link
Member

JC5 commented Apr 29, 2024

Not a problem, glad I could help!

@JC5 JC5 closed this as completed Apr 29, 2024
Copy link
Contributor

Hi there! This is an automatic reply. Share and enjoy

This issue is now 🔒 closed. Please be aware that closed issues are not monitored by the developer of Firefly III.

  • If the original bug is not actually fixed, please open a new issue. Refer to this issue for clarity.
  • Follow-up questions must be posted in a new discussion
  • Further replies to this issue may get no response.

If there is more to discuss, please open a new issue or discussion.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants