Skip to content

revert: remove CP toast notification on decrypt failure#7

Merged
andrii-trush merged 1 commit into
mainfrom
feature/cp-toast-decrypt-failure
Feb 18, 2026
Merged

revert: remove CP toast notification on decrypt failure#7
andrii-trush merged 1 commit into
mainfrom
feature/cp-toast-decrypt-failure

Conversation

@andrii-trush
Copy link
Copy Markdown
Member

Summary

  • The toast delivery was unreliable across all tested paths. On page refresh, Listing.vue's AbortController cancels the first request after the server has already consumed the dedup cache key — so the second (actually-read) response carries no _toasts. The session()->flash() fallback only appeared on the next page load and produced confusing UX (showed a toast saying literally "error" due to a separate message bug).
  • FieldEncryptor::decrypt() now simply logs a Log::warning and returns the raw ciphertext on failure — no side-effects.
  • Removed the $context parameter from decrypt() and updated both repository callers.
  • Removed the decrypt_failure_toast lang string, the NOTIFY_TTL constant, and all related imports (Toast, Cache, Statamic, session).
  • Removed two stale FieldEncryptorTest cases that asserted the absence of Toast::error() calls — they passed trivially once the code was gone.
  • Updated OVERVIEW.md and PLAN.md to reflect the simplified behaviour.

The toast delivery proved unreliable across all tested paths:
- AddToasts/Axios interceptor path fails on page refresh because
  Listing.vue's AbortController cancels the first request after the
  server has already consumed the dedup cache key, so the second
  (actually-read) response carries no _toasts.
- session()->flash() path shows only on the subsequent page load and
  produced confusing UX.

Remove all associated code and tests:
- Drop Toast, Cache, Statamic imports and NOTIFY_TTL constant from
  FieldEncryptor; decrypt() now just logs a warning and returns the
  raw value on failure.
- Remove the $context parameter from decrypt() and update both
  repository callers.
- Remove the decrypt_failure_toast lang string.
- Remove two now-stale FieldEncryptorTest cases (they tested absence
  of Toast calls, which passed trivially after the code was gone).
- Update OVERVIEW.md and PLAN.md to reflect the simplified behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andrii-trush andrii-trush force-pushed the feature/cp-toast-decrypt-failure branch from 33d4961 to 91b2baa Compare February 18, 2026 19:15
@andrii-trush
Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@andrii-trush andrii-trush merged commit 9a75cd7 into main Feb 18, 2026
4 checks passed
@andrii-trush andrii-trush deleted the feature/cp-toast-decrypt-failure branch February 18, 2026 19:21
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

Successfully merging this pull request may close these issues.

1 participant