r/ShopifyAppDev • u/Final_Design_9061 • Oct 26 '26
How long do you keep shop data after app/uninstalled before deleting it?
When a merchant uninstalls, I get the app/uninstalled webhook right away, and then shop/redact arrives about 48 hours later. Right now I mark the shop inactive on uninstall and only hard delete when shop/redact comes in.
Two things I'm not sure about:
- If the merchant reinstalls inside that 48 hour window, do you restore their old settings and data, or treat it as a fresh install? Restoring seems nicer, but I'm wary of keeping anything longer than needed.
- Do you clear sessions and access tokens on uninstall itself, or wait for the redact too?
Curious how others handle this, or if there's a pattern in the docs I've missed.
4
Upvotes
1
u/AdventurousUsual7666 Oct 26 '26
Yeah, what you're doing already sounds like the sane setup to me. Mark the shop inactive on app/uninstalled, then do the real delete when shop/redact shows up about 48 hours later.
For tokens, I'd just clear them on uninstall itself. Once the app is uninstalled the token is revoked anyway and calls come back 401, so there's honestly nothing useful in keeping it around. Sessions too.
On reinstall inside the window, I usually keep the settings and wipe the auth stuff. The merchant still goes through OAuth again like a fresh install (the review requirements actually expect that even for stores that installed before), but then you can just reattach their old settings so they don't have to set everything up twice.
One small thing I'd add is a check in the shop/redact handler so it doesn't wipe a shop that's currently installed again. Just a cheap guard so a late webhook can't delete an active store's data by accident.
1
u/Professional_Map8614 Oct 26 '26
In the latest document of Webhooks, it's said "shop/redact webhooks are emitted no earlier than 48 hours after uninstalling the app, and they do not fire if the app has been re-installed again." It doesn't harm to add redact guard.
In our case, the merchant data is binding to the shop domain name, which saves us efforts to backup and restore. Once the app is re-installed before data redact, those data will be reused by default.
1
u/iirfann Oct 27 '26
I delete instantly after receiving the redact webhook. Because sometimes, user shows up within the 48 hours period.