Track who assigned a transaction's kind and category
Author: shkarinnCreated Sep 28, 2026Updated Sep 28, 2026
Problem
After #3762, transfer kinds and the Investment Contributions category are applied only when a transfer match is confirmed (Transfer#confirm!). Three cases remain. In each, a value that came from matching is left on a transaction that is no longer part of a confirmed transfer. Sure cannot undo it safely, because it does not record who assigned a transaction's kind or category.
- Reject after confirm. Confirming an uncategorized investment outflow assigns the Investment Contributions category.
Transfer#reject!resets the kind tostandardbut keeps the category. The rejected outflow then counts toward category and budget totals with a category taken from a discarded match. (The same happened before #3762, at auto-match time.) - Legacy pending matches in the database. Migration
20260927200000_reset_kinds_of_pending_transfer_matchesresets the kinds of pending matches. It does not clear categories that the old auto-matcher assigned, because they can't be told apart from categories the user chose. - Restoring backups made before #3762.
Family::DataImporter#import_transactionsrestores exported kinds. A pending match from an old backup can therefore bring back kinds derived from the match. The importer can't reset them, because kinds for pending legs can also come from the provider (e.g. Up'sfunds_movement).version.txthas only the genericexport_version.
Proposed direction
Record the origin of a transaction's kind and category, for example via a column or entry metadata: set by the matcher/confirmation, by the provider, or by the user. With that recorded, reject, the migration path and the importer can revert only what the match set.
Raised in review of #3762:
Source: we-promise/sure