mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 12:52:11 +03:00
Payload rules are written to the DB (key_value settings.payloadRules) and mirrored into an in-memory runtimeOverride. After a restart, if runtimeOverride is null — the boot applyRuntimeSettings hook didn't run in this module instance, or a separate bundle instance in the standalone Next.js build — getPayloadRulesConfig fell back to the (usually empty) config/payloadRules.json file and returned no rules, so saved rules appeared to vanish. The persistence/apply path is correct on inspection (DB write+read both use the 'settings' namespace; the boot hook sets the override with force:true); the null override is an environment/bundling effect. Make getPayloadRulesConfig read the DB-persisted rules (via getCachedSettings, the source of truth) before the file when no override is set, so saved rules deterministically survive a restart. Closes #2986