Skip to content

v3.13.0

Choose a tag to compare

@HollowTheSilver HollowTheSilver released this 18 Sep 01:11
· 14 commits to main since this release

This release settles who owns a persistent panel's registration: the message that wrote it, rather than whichever panel exits last under a shared key. That makes panel swaps safe to roll back, gives you retire_previous_on_send when you want to confirm the new panel before the old one comes down, and closes a run of registry bugs that only showed up after a restart. A view whose message disappears is now torn down even when the gateway never reports the deletion.

Breaking

  • An ack backstop delay of 3.0 seconds or more now raises ValueError when its class is defined. Lower it below 3.0 before upgrading. This covers auto_defer_delay on views, DynamicPersistentButton and Modal, and a form's text_edit_modal_auto_defer_delay. The backstop sleeps for the delay and then defers, so a value at or past Discord's three-second deadline could never land, and every handler slower than three seconds failed with nothing raised. The guides already named 3.0 as the ceiling; nothing enforced it.

Added

  • retire_previous_on_send for replacing a panel under its own key. A send under a key another panel holds exits that panel during the send, which leaves nothing to fall back on when the new panel still has to be confirmed. Set it to False to retire the predecessor yourself once the swap succeeds; exiting the new panel instead hands the registration back to the old one while it is still live.
  • StateStore.get_active_view(persistence_key=...) finds the live panel for a key. Code outside a view, a scheduler refreshing a posted panel or a command retiring one, no longer needs its own registry of panel instances. A finished view is never returned, and a panel that navigated away with push() answers with the view now on its message.
  • PersistenceManager.total_reattach_summary covers every reattach pass. The per-pass summary holds only the latest one, and the reattach() re-drive recommended for late-loading cogs replaces it before on_ready runs, so a reconcile keyed on removals found an empty list. The new property carries the same five buckets with each key under its most recent outcome.
  • PersistenceMiddleware(prune_unreachable_after_days=...) prunes unreachable registry rows without a caller. Rows that could not be fetched were kept and retried at every boot until someone ran prune_unreachable(). With the setting, the manager runs that prune once the gateway is ready and daily after, with the same re-verification against Discord.

Changed

  • prune_registry() warns when it deletes the row of a live panel, and prune_unreachable() re-checks its candidates concurrently. prune_registry matches by key, so it takes whatever holds that key, and a panel running under it stayed on screen while quietly losing the registration that restores it. The deletion is unchanged and now says so. The unreachable sweep verified one row at a time while holding the registry lock, which is slowest exactly when an outage stamped many rows at once. Verification now runs under the same bound the reattach pass uses, and the verdicts are unchanged.

Fixed

  • Exiting a superseded panel no longer clears its successor's row, and exiting a panel that never sent removes nothing. A registration now belongs to the message that wrote it, so a panel that no longer owns the key leaves it alone. Cleaning up after a failed send previously retired the panel actually on screen, which then went unrestored after the next restart.
  • exit() on a persistent view restored after a restart deletes its registry row. Only a send recorded a panel in the store's copy of the registry, so a restored panel was never in it: its exit() changed nothing and the panel came back on every boot. Rows left behind by earlier versions are not removed automatically; retire them with prune_registry(persistence_keys=[...]).
  • A view whose message is deleted is torn down even when the bot never hears about the deletion. Teardown came only from the gateway's message-delete events, which a bot without the message intents never receives. An edit that finds the message gone now tears the view down through on_message_delete(), so every view whose edit returns "Unknown Message" is retired, persistent rows included. Deleting the channel or thread the message sits in, which Discord never reports as message deletions, now does the same, and a view one hook already tore down is not called again by another.
  • A reattach re-drive no longer restores a panel whose registration this process already deleted, or attaches a second instance beside a panel already running. The first left a live panel answering clicks with no row behind it. The second left two live views answering for one message.
  • A teardown edit is validated before it ships, and a restored panel torn down before its first render is frozen from what its message actually shows. The teardown edit was the one render path without placement validation, so a tree Discord rejects reached it and failed with a 400. A restored panel that never rendered has no tree of its own worth shipping, so the freeze now rebuilds what is on screen, uploaded images and file cards included.
  • A child view that stopped on its own no longer lingers in the registries after its parent exits. It stayed visible in the inspector, counted against instance limits, and was skipped by every later cleanup path.
  • A reducer that declines an action no longer reverts state committed while its dispatch was waiting. Reached with middleware that awaits real work, an audit log or a metrics push, on the paths where a refusal is routine.
  • /cascadeui reset no longer drops the registry mirror and the modal rows, and /cascadeui exitall and /cascadeui reset no longer exit a view twice when one exit's cascade already tore it down.

Documentation

docs-RetirePreviousOnSend
docs-get__active__view
docs-ReattachSummaries
docs-prune__unreachable
docs-on__message__delete
docs-ClassAttributes

Install

pip install pycascadeui==3.13.0

See the full CHANGELOG for every entry.

Full Changelog: v3.12.3...v3.13.0