Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON export? #4

Open
chmac opened this issue Feb 21, 2022 · 8 comments
Open

JSON export? #4

chmac opened this issue Feb 21, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@chmac
Copy link

chmac commented Feb 21, 2022

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.

@cryptoboid cryptoboid added the enhancement New feature or request label Feb 22, 2022
@cryptoboid
Copy link
Owner

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 😅

@chmac
Copy link
Author

chmac commented Feb 22, 2022

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
Copy link
Author

chmac commented Feb 23, 2022

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
Copy link
Author

chmac commented Apr 1, 2022

@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.

@cryptoboid
Copy link
Owner

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

@chmac
Copy link
Author

chmac commented Apr 6, 2022

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

@cryptoboid
Copy link
Owner

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

@cryptoboid
Copy link
Owner

cryptoboid commented Apr 12, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants