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

useCreatePost with timed collects causes an error on CreatePostTypedData #498

Closed
moesalih opened this issue Aug 15, 2023 · 2 comments
Closed

Comments

@moesalih
Copy link

moesalih commented Aug 15, 2023

Describe the bug
setting endTimestamp when creating a post causes an api error on the CreatePostTypedData endpoint when the dispatcher is not allowed and we're trying to do a self funded fallback. The error is:
UnspecifiedError: invalid BigNumber string (argument="value", value="NaN", code=INVALID_ARGUMENT, version=bignumber/5.6.2)

the endTimestamp value i'm providing is a number as required by the sdk, example: 1692201833189

I noticed that the sdk is sending the endTimestamp to the api as a string, for example: "1692201833189", so as a workaround i tried to provide an ISO string for the endTimestamp like "2023-08-16T16:33:02.277Z" like i do in the mobile app, and that seems to work for simple collects, but for multi recipient collects, i get another error from the sdk and not from the api:

error InvariantError: fix the following issues
· "collect" expected to match one of the following groups:
		· "collect.recipient": Required
	OR:
		· "collect.endTimestamp": Expected number, received string
	OR:
		· "collect.recipient": Required
		· "collect.vault": Required
		· "collect.endTimestamp": Expected number, received string
	OR:
		· "collect.recipient": Required
		· "collect.depositToAave": Invalid literal value, expected true
		· "collect.endTimestamp": Expected number, received string
	OR:
		· "collect.type": Invalid literal value, expected "FREE"
	OR:
		· "collect.type": Invalid literal value, expected "NO_COLLECT"

Version of the packages you are using
react-web 1.3 next.9

@cesarenaldi
Copy link
Member

hey @moesalih this is an interesting one.

There has been some inconsistencies in the way Lens API ingest/produce Date and timestamps across different queries/mutations so cannot exclude the SDK got caught up in one of these and is asking for date in the wrong format.

Let me run some tests and get back to you on this one.

@cesarenaldi
Copy link
Member

This is all being rewritten in v2. What used to be timestamps are all now date times. Closing this issue for now.

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

No branches or pull requests

2 participants