splitio icon indicating copy to clipboard operation
splitio copied to clipboard

JSON export?

Open chmac opened this issue 3 years ago • 8 comments
trafficstars

I've created a couple of groups, and I'm slightly worried that people in the group will accidentally mess with the data, delete stuff, or whatever. It would be great to have a JSON export of all the data for a group (plus probably an import option). But, maybe this is unnecessary with GunDB, perhaps the history is always visible with GunDB, I'm not sure.

Also, I'm happy to put some time into some of these feature suggestions, I'm not super familiar with Svelte or GunDB but I have lots of frontend TypeScript experience.

chmac avatar Feb 21 '22 21:02 chmac

Hmmm, this one is a bit more difficult. For now, Gun stores the data in localStorage, so you could grab that and decrypt it with the group key (the string after the # in the URL). It would be good to have some way to export info from splitio, because I also have my doubts about data consistency with Gun. The data history is not visible with Gun, only the current state.

This is my first time with Svelte and Gun too! Svelte is super easy to pick up, you should try it out. I'm trying out Typescript also, so I need some help defining types, interfaces and that kind of stuff. Currently the code looks more like JS than TS 😅

cryptoboid avatar Feb 22 '22 13:02 cryptoboid

I'm most familiar with React, but I've read a bit about svelte.

If there's any specific topics you're looking for help with types, feel free to create issues and either assign them to me or mention me and I'll try to lend a hand.

chmac avatar Feb 22 '22 18:02 chmac

What about a plain text export instead? Just a quick way to see all the data (including the computed balances) as a single string. It could also be a "snapshot" feature, to capture into localStorage or so. My personal experience is that localStorage is nothing like as persistent as my own filesystem (mobile or desktop). I'm always nervous of leaving any data I actually care about only in localStorage.

chmac avatar Feb 23 '22 07:02 chmac

@cryptoboid If you'd be open to pointing me in the right direction, I'd be down to put some time into this. We do quite a few collective expense events, and I now find that I can't get back to the 2 groups I created in the past. Their data just never loads. At least on mobile. Personally, I don't trust localStorage for the long term, and I'm happy running my own servers, so this topic becomes a significant blocker for me using splitio on every project.

chmac avatar Apr 01 '22 09:04 chmac

Hi, so, I've just pushed to dev an inspector page. Try inspecting your group by replacing like so: https://splitio.vercel.app/g/XXXXXXXXXXXXXX#YYYYYYYYYYYYYYYYY -> https://splitio-dev.vercel.app/inspector/XXXXXXXXXXXXXX#YYYYYYYYYYYYYYYYY

(add -dev and replace g with inspector)

For now it just shows parsed info from localstorage, indexeddb and optionally gun. You will find that local info is encrypted, but it may be useful at least

cryptoboid avatar Apr 02 '22 17:04 cryptoboid

@cryptoboid That's awesome. Any chance to deploy it on the production domain also, then I could inspect my localStorage, etc for live groups.

chmac avatar Apr 06 '22 08:04 chmac

Already in production! You can test it in https://splitio.vercel.app/inspector/XXXXXXXXXXXXXX#YYYYYYYYYYYYYYYYY

cryptoboid avatar Apr 06 '22 13:04 cryptoboid

update: ~~so, I've found an old group where this same behaviour happens. Strangely, (and luckily!) all info is still available in the indexedDB (and localStorage too, it was an old group) but Gun isn't picking it up for some reason. That means we can have a recovery mechanism that recreates the group data :) bad news is that it would require reverse-engineering gun's storage code, which will be super annoying, but at least we have some hope~~

nope, got confused by older info, it isn't there. Have you found your group info in the inspector?

cryptoboid avatar Apr 12 '22 00:04 cryptoboid