Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.
This repository was archived by the owner on Oct 21, 2026. It is now read-only.

Bad JSdoc placement on Topic.setMetadata #1093

Closed

Description

@mgabeler-lee-6rs

Thanks for stopping by to let us know something could be better!

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

  • OS: Irrelevant
  • Node.js version: Irrelevant
  • npm version: Irrelevant
  • @google-cloud/pubsub version: v2.5.0

Steps to reproduce

  1. Install the latest version of @google-cloud/pubsub
  2. Look for JSdoc for Topicl.setMetadata method
  3. Sadness

There is JSdoc for this method in the source: https://github.com/googleapis/nodejs-pubsub/blob/master/src/topic.ts#L835

However, I believe it is placed incorrectly in relation to the overload declarations. Regardless, it is missing from the published .d.ts file:

    /**
     * In the event that the client fails to publish an ordered message, all
...
     */
    resumePublishing(orderingKey: string): void;
    setMetadata(options: TopicMetadata, gaxOpts?: CallOptions): Promise<SetTopicMetadataResponse>;
    setMetadata(options: TopicMetadata, callback: SetTopicMetadataCallback): void;
    setMetadata(options: TopicMetadata, gaxOpts: CallOptions, callback: SetTopicMetadataCallback): void;
    /**
     * Set the publisher options.
...

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: docsImprovement to the documentation for an API.
    on Aug 20, 2020
  2. feywind commented on Aug 20, 2020

    @feywind
    Contributor

    Thanks for the report! I'll add this to my list of docs/comments cleanup issues.

  3. self-assigned this
    on Sep 15, 2020
  4. added
    🚨This issue needs some love.
    and removed
    🚨This issue needs some love.
    on Dec 14, 2020
  5. feywind commented on Feb 18, 2021

    @feywind
    Contributor

    Actually, there are a bunch of them missing. There are a lot fewer that have JSDoc in the .d.ts that have them than the ones that don't. I wonder if something changed in the way the typings JSDoc is generated, because the generated HTML doc pages do actually have the comments.

  6. feywind commented on Feb 18, 2021

    @feywind
    Contributor

    This seems to be related: microsoft/TypeScript#25590

    It seems TypeScript still doesn't want to support JavaScript style overloaded functions/methods. I'm going to flip this to a feature request, because I think it's going to take more effort to correct. :|

  7. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    🚨This issue needs some love.
    type: docsImprovement to the documentation for an API.
    on Feb 18, 2021
  8. feywind commented on Feb 18, 2021

    @feywind
    Contributor

    Hmm, the answer I'm getting seems to be: this isn't a great solution, but it's less bad than the other solutions we considered. TypeScript and JSDoc have a complicated relationship, apparently. It's intentional that we are just putting the comments into the generated .js files, but it does seem confusing to me that it's in the .d.ts for only some of the methods.

  9. removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Feb 18, 2021
  10. added
    type: docsImprovement to the documentation for an API.
    and removed
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Feb 18, 2021
  11. locked and limited conversation to collaborators on Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions