Hi! I’m testing my extension locally with Hosted Test and I’m seeing an issue with Configuration persistence.
Setup:
-
I host my views locally over HTTPS: https://localhost:8080 (config.html and video_component.html).
-
I start a live stream so I can open the extension on my channel.
-
In the extension’s Config view, I save config to the broadcaster segment and also broadcast an update:
const ext = window.Twitch.ext;
const version = new Date().toISOString();
const content = JSON.stringify({ nickname: “foo” });
ext.configuration.set(“broadcaster”, version, content);
ext.send?.(
“broadcast”,
“application/json”,
JSON.stringify({ type: “config_updated”, data: { nickname: “foo” } })
);
In the Video Component view, I listen to:
ext.listen("broadcast", ...)
ext.configuration.onChanged(...)
ext.onAuthorized(...)
Behavior:
-
Immediately after saving, the video component receives the broadcast and also reacts to configuration changes as expected.
-
However, if I reload the Twitch page with the stream and reopen the extension, ext.onAuthorized fires, but ext.configuration.broadcaster is undefined. It looks like the saved config isn’t persisted, and I have to re-enter it via the config view again.
Questions:
-
Am I missing a step to persist the Configuration Service data during Hosted Test on localhost?
-
Is this expected behavior in local/Hosted Test (e.g., config not persisted between page reloads), and will it behave differently once hosted on a server or in a packaged version?
-
Are there any known caveats about when ext.configuration.onChanged fires relative to ext.onAuthorized, or about accessing ext.configuration.broadcaster on first load?
Any guidance on the correct testing flow or what I might be doing wrong would be appreciated. Thanks!
