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

view data #3

Merged
merged 10 commits into from
Dec 11, 2024
Merged

view data #3

merged 10 commits into from
Dec 11, 2024

Conversation

turadg
Copy link

@turadg turadg commented Dec 11, 2024

fixes: #2

I went a little farther since I depend on this tool so much. E.g. converting to Vite from CRA which is no deprecated.

The main UX change is making data render and doing it a little more clearly when it does.

Before

https://vstorage.agoric.net/?path=published.wallet.agoric10yw7lsgqgajcc4veeeua65je79tyeg9x8t6f5y.current&endpoint=https%3A%2F%2Fmain-a.rpc.agoric.net%3A443&height=null

(manually collapsing body children)
Screenshot 2024-12-10 at 4 20 09 PM

After

http://localhost:5173/?path=published.wallet.agoric10yw7lsgqgajcc4veeeua65je79tyeg9x8t6f5y.current&endpoint=https%3A%2F%2Fmain-a.rpc.agoric.net%3A443&height=null

(same collapsing)

Screenshot 2024-12-10 at 4 21 00 PM

Copy link

@0xpatrickdev 0xpatrickdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled down locally to verify.

I see published.wallet.${addr} data now rendering which is an improvement.

Didn't audit the parsing logic closely, but left feedback where it seems we're always expecting capData and sometimes it's just JSON.

src/App.js Outdated Show resolved Hide resolved
src/App.jsx Outdated
Comment on lines 106 to 116
console.log("Data received from fetchData:", response.data.value);
const take2 = storageHelper.unserializeTxt(response.data.value);
console.log("DEBUG take2", take2);
const obj = JSON.parse(response.data.value);
console.log("DEBUG obj", typeof obj, obj);
obj.values = obj.values.map((v) => JSON.parse(v));
console.log("DEBUG obj.values", obj.values);
setDataView(obj);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these console.log's intentional? What's difficult to work out?

I pulled this down locally. For fastUsdc it doesn't seem to render keys that include JSON - only capData. Examples are the fastUsdc root and fastUsdc.status.${hash}. I also noticed the old p2p-agoric-vstorage-viewer struggled with JSON as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were intentional while debugging. Looks like you were reviewing by commit. They're not in HEAD.

I don't see much value in cleaning those out of the commit history but would entertain the request

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it tho

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you were reviewing by commit

Yep, thanks for removing, though.

it doesn't seem to render keys that include JSON - only capData

Was this an observation you also had?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I want to solve this in client-utils vstorage.js or vstorage-kit.js by making them handle non-capdata JSON and even bare values

Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2024

Deploying vstorage with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf2b4fc
Status: ✅  Deploy successful!
Preview URL: https://b9380f06.vstorage.pages.dev
Branch Preview URL: https://ta-2-view-data.vstorage.pages.dev

View logs

@turadg turadg merged commit c241723 into master Dec 11, 2024
1 check passed
@turadg turadg deleted the ta/2-view-data branch December 11, 2024 16:47
mergify bot added a commit to Agoric/agoric-sdk that referenced this pull request Dec 11, 2024
_incidental_

refs: agoric-labs/vstorage-viewer#2

## Description
In the course of working on agoric-labs/vstorage-viewer#3 it was hard to work with an async `makeVstorageKit`. It was async because construction of the kit required fetching a bunch of data from vstorage to populate `agoricNames`.

That concern is a higher level than vstorage so this pulls it out. That allows `makeVstorageKit` to be synchronous.

I added a test of `makeAgoricNames` both before and after.

Eventually I think something should make it easy to make an AgoricNamesKit that wraps `VstorageKit` the way `VstorageKit` wraps `Vstorage`. `makeWalletUtils` does that but needs more work. At least renaming to `SmartWallet` but it would help to have a rethink of the layering and vstorage decoding in client-utils.

### Security Considerations
none

### Scaling Considerations
none

### Documentation Considerations
not documented but this will make it less complex

### Testing Considerations
new test

While refactoring, tsc really let me down by not detecting destuctured properies that were no longer on the source object. I suppose our settings aren't strict enough. I enabled `noImplicitAny` to detect those (by then filtering for makeVstorageKit)

### Upgrade Considerations
n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data doesn't show up for published.wallet.xxx
2 participants