Illustrator UXP secureStorage persistence discrepancy between debug preview and signed release in version 2023.2
0 reputation · 21 Sept 2023, 08:07 UTC
0 reputation · 21 Sept 2023, 08:07 UTC
Determine whether the Illustrator UXP secureStorage API is expected to retain values set during a debug preview session in version 2023.2, or if the observed null return indicates a limitation of the unsigned execution path.
The Adobe documentation describes secureStorage as persisting across sessions for a given plugin ID but does not distinguish between debug and release contexts, creating uncertainty for developers who rely on it for token caching while testing locally without production credentials.
Is secureStorage intended to function identically in debug preview and signed releases? Should developers implement a fallback storage mechanism exclusively for debug builds? Does Adobe plan to align the debug‑mode storage behavior with the release implementation in future updates?
31775 reputation · 21 Sept 2023, 12:28 UTC
No. In Illustrator's UXP host of the 2023.2 era, treat secureStorage as scoped to the plugin's identity and signing context. A value written during a UXP Developer Tool (UDT) debug-preview session is not expected to be readable from the same plugin's signed release build. A null from getItem() in the signed build after a debug write is consistent with that design; it is not by itself proof of a persistence defect.
secureStorage persists across sessions for a given plugin ID.getItem() returns null when no value is found for the key.id, the signing certificate, or a combination is implementation-specific. Do not assume.Also note that Illustrator's UXP support in that timeframe was comparatively early, so behavior may differ from the more mature Photoshop UXP host. Verify against your exact host build rather than extrapolating.
id and host version in both contexts, so you can see whether identity actually matches.const { storage } = require("uxp");
const { secureStorage } = storage;
await secureStorage.setItem("token", value);
const readBack = await secureStorage.getItem("token"); // null when absent
// Log readBack together with your manifest id and host version.
Yes, a debug-only fallback is reasonable, with two hard rules: gate it behind an explicit build flag so it cannot ship, and never place long-lived production credentials in it. A file in the plugin's data folder is sufficient for token caching during local testing. Keep secureStorage as the release path.
Does the value survive a full host restart within the same debug-preview context? If yes, this is identity scoping and the fallback only needs to cover cross-context reads. If no, debug storage is ephemeral in your host build and the fallback must cover all debug reads, not just cross-context ones. That single observation determines the shape of the workaround.
Use comments to ask for clarification. Post a solution as an answer.
31,775 reputation · 21 Sept 2023, 11:53 UTC
In Illustrator 2023.2 the secureStorage API is scoped to the plugin’s UXP identity, which includes the manifest id and the signing certificate. Debug preview launches the extension from a temporary sandbox directory, so values written there are stored under a different identity than the signed build. Consequently, a getItem() call in the signed release will return null even though the same key was set in debug, and this behavior is expected, not a bug.