Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

chrome.gcm method signatures are very, very unreadable #5176

Closed
rdcronin opened this issue Feb 6, 2023 · 2 comments · Fixed by GoogleChrome/chrome-types#52
Closed

chrome.gcm method signatures are very, very unreadable #5176

rdcronin opened this issue Feb 6, 2023 · 2 comments · Fixed by GoogleChrome/chrome-types#52
Labels
bug Something on the site is broken! P2 A normal priority task. This is the default for most issues.

Comments

@rdcronin
Copy link
Contributor

rdcronin commented Feb 6, 2023

The generated signature for chrome.gcm.register is extremely unreadable.

I suspect that this is because the signature takes in a single argument, an array with at least one element and no more than 100 elements:

https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/extensions/api/gcm.json;l=20-31;drc=2857c6b778eb16623281c8e1206ad85baa63cedd

It looks like maybe we're then trying to generate each possible signature? (array of length one, array of length two, array of length three..., array of length 100).

If this is what's going on, it doesn't scale. It's an issue in chrome.gcm, and it would also be an issue with any API where there are multiple arguments (since then you have combinatorial signatures).

Instead of this, could we add a tag to the argument indicating the min / max length?

@rdcronin rdcronin added bug Something on the site is broken! P2 A normal priority task. This is the default for most issues. labels Feb 6, 2023
@AaronForinton
Copy link
Contributor

Hi there @rdcronin and thanks for submitting your issue.

Since this issue relates to Chromium rather than our documentation base, please submit it at https://crbug.com/. Thank you.

@rdcronin
Copy link
Contributor Author

@AaronForinton This isn't a bug in Chromium. The signature in Chromium is accurate; the method can take an array with a list of strings, and that list must have 100 or fewer elements. It is properly implemented and specified in the schema file, but the files generated for the documentation site represent it by generating every possible signature. We should change that so that it doesn't output every possible signature, but rather that it takes an array of strings with a maximum length of 100.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something on the site is broken! P2 A normal priority task. This is the default for most issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants