whisper-money/app/Jobs
Víctor Falcón b7ff4e074d Move residual-encryption cleanup out of Inertia share() into a queued job
HandleInertiaRequests::share() is an Inertia shared-data provider and should be
read-only, but it ran a DELETE + UPDATE against the user on every non-API web
GET to purge the leftover encryption salt and EncryptedMessage once a user no
longer had any encrypted accounts or transactions. Writing to the database
while resolving render props is a side effect in the wrong place.

The existing encryption commands do not cover this case: both
NotifyEncryptedDataRemovalCommand and DeleteEncryptedDataAccountsCommand target
users who *still* have encrypted data, whereas this cleanup finalizes users who
have *finished* decrypting. To preserve that eventual-cleanup semantics without
writing during the render, the work now goes to a new
PurgeResidualEncryptionArtifactsJob dispatched from share(). The job re-checks
the condition on execution and is idempotent, so repeat dispatches are no-ops.

The two ->exists() checks stay because they still feed the hasEncryptedAccounts
and hasEncryptedTransactions props.

Tests: InertiaSharedDataTest asserts a web GET no longer mutates the user inline
and instead queues the job (and does not queue it when there is no salt); a new
PurgeResidualEncryptionArtifactsJobTest covers the clear, the two 'still has
encrypted data' guards, and the null-salt no-op.
2026-07-04 20:18:49 +02:00
..
Drip feat(email): follow up after post-onboarding AI consent (#596) 2026-06-26 17:56:06 +00:00
ApplySingleAutomationRuleJob.php fix(security): scope job-status endpoints to owner + feature-area fixes (#627) 2026-07-03 14:49:32 +02:00
AssignHistoricalTransactionsToBudget.php feat: Load transactions history on budget created (#72) 2026-01-22 11:10:15 +01:00
CategorizeOnboardingTransactionsJob.php feat(ai): manage AI consent outside onboarding with live backfill (#591) 2026-06-25 10:50:35 +02:00
CategorizeUncategorizedTransactionsJob.php fix(security): scope job-status endpoints to owner + feature-area fixes (#627) 2026-07-03 14:49:32 +02:00
GenerateHistoricalLoanBalancesJob.php feat(loans): backfill historical balances on loan creation (#322) 2026-04-24 13:09:34 +01:00
GenerateHistoricalRealEstateBalancesJob.php feat(real-estate): auto-calculate revaluation % and generate historical balances (#253) 2026-04-15 12:18:33 +00:00
GenerateRuleSuggestionsJob.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
PurgeResidualEncryptionArtifactsJob.php Move residual-encryption cleanup out of Inertia share() into a queued job 2026-07-04 20:18:49 +02:00
ReEvaluateTransactionRulesJob.php fix(security): scope job-status endpoints to owner + feature-area fixes (#627) 2026-07-03 14:49:32 +02:00
RetryTransientAiCategorizationJob.php fix(ai): handle transient AI provider overloads — stop the Sentry noise and retry the dropped work (#595) 2026-06-26 20:07:06 +02:00
SendDailyBankTransactionsSyncedEmailJob.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
SendUpdateEmailJob.php Support soft-deleted users with reusable emails (#316) 2026-04-22 11:41:41 +01:00
SyncAllBankingConnectionsJob.php refactor: centralize duplicated provider & locale keys into enums (#543) 2026-06-16 13:43:14 +00:00
SyncBankingConnectionJob.php fix(banking): only log sync failures once the connection gives up (#603) 2026-06-27 16:04:36 +00:00
SyncBinanceHistoricalBalancesJob.php feat: Add Binance integration (#131) 2026-02-18 15:23:46 +01:00