p-table stateStorage stateKey rotation after schema change
0 reputation · 06 Sept 2026, 02:22 UTC
p-table stateStorage with stateStorage="local" or "session" and a stateKey persists sorting, filters, pagination and column state across navigation and reloads. The design goal is to keep a stable user experience while avoiding stale UI after an application update changes columns, filter metadata or the data shape.
The constraints are that PrimeNG does not provide built-in versioning or expiry for persisted state. The stateKey is the sole identity for the stored entry, session storage clears on tab close while local storage persists indefinitely, and restored state is applied on table initialization which may precede asynchronous data loading. Saved fields and timing can vary across PrimeNG major versions.
What is persisted by stateStorage in the target PrimeNG version and is the set of fields stable across versions? Does rotating or namespacing the stateKey reliably invalidate prior entries without manual storage clearing? How can restored filters be reconciled with a changed schema so rows are not silently hidden after an upgrade?