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

fix: handle all empty responses in filter #1688

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

vpavlin
Copy link
Member

@vpavlin vpavlin commented Oct 25, 2023

Problem

I got an exception about undefined res - seems

waku:filter:v2 Error pinging:  +11ms TypeError: res[0] is undefined

Seems like this d049ebb only fixed subscribe and ping and unsubscribe still needed the check

Solution

Add check and throw an error for empty response

Notes

  • Resolves
  • Related to

Verified

This commit was signed with the committer’s verified signature.
danisharora099 Danish Arora
@vpavlin vpavlin requested a review from a team as a code owner October 25, 2023 20:13
@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 83.85 KB (0%) 1.7 s (0%) 375 ms (+33.47% 🔺) 2.1 s
Waku Simple Light Node 264.23 KB (+0.02% 🔺) 5.3 s (+0.02% 🔺) 736 ms (+11.36% 🔺) 6.1 s
ECIES encryption 79.46 KB (0%) 1.6 s (0%) 511 ms (+24.09% 🔺) 2.2 s
Symmetric encryption 79.47 KB (0%) 1.6 s (0%) 303 ms (-28.98% 🔽) 1.9 s
DNS discovery 111.22 KB (0%) 2.3 s (0%) 487 ms (-0.91% 🔽) 2.8 s
Privacy preserving protocols 131.77 KB (0%) 2.7 s (0%) 498 ms (-11.14% 🔽) 3.2 s
Light protocols 81.59 KB (+0.02% 🔺) 1.7 s (+0.02% 🔺) 403 ms (+19.94% 🔺) 2.1 s
History retrieval protocols 80.54 KB (0%) 1.7 s (0%) 330 ms (-22.22% 🔽) 2 s
Deterministic Message Hashing 5.65 KB (0%) 113 ms (0%) 61 ms (-10.57% 🔽) 174 ms

Copy link
Collaborator

@fryorcraken fryorcraken left a comment

Choose a reason for hiding this comment

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

LGTM but I think the API should be more consistent.

We are using throwing Error here whereas for light push we return error codes. We decide whether it's one or the other across the APIs.

cc @waku-org/js-waku-developers

@danisharora099
Copy link
Collaborator

LGTM but I think the API should be more consistent.

We are using throwing Error here whereas for light push we return error codes. We decide whether it's one or the other across the APIs.

cc @waku-org/js-waku-developers

IMO, returning error codes is an approach we should follow through the codebase.

@weboko
Copy link
Collaborator

weboko commented Oct 26, 2023

Agree with error codes approach for recoverable failures. I think for failures that prevent the flow - we might still try throwing.

@weboko weboko merged commit b3864f8 into master Oct 26, 2023
@weboko weboko deleted the fix/missing-res-check branch October 26, 2023 08:46
@fryorcraken
Copy link
Collaborator

Agree with error codes approach for recoverable failures. I think for failures that prevent the flow - we might still try throwing.

#1694

danisharora099 pushed a commit that referenced this pull request Nov 2, 2023

Verified

This commit was signed with the committer’s verified signature.
danisharora099 Danish Arora
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.

4 participants