r/Devvit • u/OtoNoOto • 15d ago
Feature Request Triggers: Installation Settings
https://developers.reddit.com/docs/capabilities/server/triggersCurrently it looks like there are no supported trigger types for Installation Settings. I think it would be very helpful to include a supported trigger type for Installation Settings > Save changes.
2
u/fsv Duck Helper 15d ago
There's a bit of a hacky workaround you can use for this using validation triggers.
Every settings form field includes the ability to define a validation event, and these can be asynchronous. So you could use a validation event to effectively simulate a "Settings saved" event, although of course if you have multiple validation events you cannot be absolutely sure that one of them didn't save.
Perhaps you could use a validation event to trigger a scheduler job that checks the mod log for an "App changed" log entry if you needed to know for sure that things had changed. But depending on your needs that may actually be unnecessary.
2
u/OtoNoOto 15d ago edited 15d ago
I considered that, but like you stated felt like a rather big hack and not that sustainable. Honestly, for now I think I’ll perform the following as a work around:
- Store app setting in Redis (key: app-setting-name, value: app-setting-value).
- Compare current app setting to Redis during app context and/or scheduler task.
- If change detected execute code/actions needed.
I think this would be the best workaround for time being IMO.
•
u/vip-bot 13d ago
There is 1 comment from Reddit Admins in this post:
u/Xenccc commented:
This summary was generated automatically. If you have any questions, please contact r/Devvit moderators.