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

make uri serializer more tolerant to type errors #551

Merged
merged 2 commits into from
Feb 9, 2024
Merged

Conversation

beyang
Copy link
Member

@beyang beyang commented Feb 8, 2024

Make the URI deserializer tolerant to the following errors that can occur in deserialization:

  • value is null or missing
  • value is a string, rather than a URI object

Previously, we saw the following errors:

Example 1: #526
Example 2:

2024-02-08 18:20:43,368 [  32696] SEVERE - o.e.l.j.j.StreamMessageProducer - An error occurred while processing an incoming message.
java.lang.NullPointerException
   at com.sourcegraph.cody.agent.protocol.ContextFileKt.uriDeserializer$lambda$1(ContextFile.kt:42)
   at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76)
   at com.google.gson.Gson.fromJson(Gson.java:1227)
   at com.google.gson.Gson.fromJson(Gson.java:1329)
   at com.google.gson.Gson.fromJson(Gson.java:1300)

Note: this PR also includes changes from #555

Test plan

Tested locally

@beyang beyang requested a review from pkukielka February 8, 2024 22:03
@beyang beyang marked this pull request as ready for review February 8, 2024 22:29
@beyang beyang enabled auto-merge (squash) February 8, 2024 22:30
Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@beyang beyang merged commit 70e6631 into main Feb 9, 2024
2 checks passed
@beyang beyang deleted the bl/uri-type-errors branch February 9, 2024 07:51
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.

2 participants