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 issue #2631 [@grpc/grpc-reflection] Issue with proto file dependencies only on second or next request #2632

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

gawsoftpl
Copy link
Contributor

@gawsoftpl gawsoftpl commented Dec 14, 2023

I found issue:

More info about issue #2631

    
    # Correct:
    const toVisit: IFileDescriptorProto[] = [...(this.fileDependencies.get(file) || [])];
    
    # was 
    # const toVisit: IFileDescriptorProto[] = this.fileDependencies.get(file) || [];
    
    while (toVisit.length > 0) {
      # Here loop get item and remove from array but if you 
      # dont spreed fileDendepencies, all depedencies will be removed from original array
      const current = toVisit.pop();

      if (!current || visited.has(current)) {
        continue;
      }

      visited.add(current);
      toVisit.push(...this.fileDependencies.get(current)?.filter((dep) => !visited.has(dep)) || []);
    }

    return Array.from(visited);
  }

Copy link

linux-foundation-easycla bot commented Dec 14, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gawsoftpl / name: Gawsoft (3f2217e)

@gawsoftpl
Copy link
Contributor Author

Hi @jtimmons can you review this?

Copy link
Member

@murgatroid99 murgatroid99 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix.

@murgatroid99 murgatroid99 merged commit 2116df0 into grpc:master Dec 14, 2023
4 of 5 checks passed
@gawsoftpl
Copy link
Contributor Author

@murgatroid99 @jtimmons Do you plan create new release for @grpc/reflection 1.0.1 with this fix? Without this server with @grpc/reflection is broken.

@murgatroid99
Copy link
Member

I merged the PR 5 minutes ago. Just have some patience and the release will go out in a reasonable amount of time.

@murgatroid99
Copy link
Member

This change has been published in @grpc/reflection 1.0.1

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.

None yet

3 participants