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

Current npm run all script is breaking #110

Open
hkleungai opened this issue Dec 5, 2024 · 0 comments
Open

Current npm run all script is breaking #110

hkleungai opened this issue Dec 5, 2024 · 0 comments

Comments

@hkleungai
Copy link

hkleungai commented Dec 5, 2024

Issues

As I started to run the npm scripts as the contribution guide suggests, I find several issues.

npm run fetch

Current await Promise.all() call in src/fetch.ts is too aggressive. Mozilla endpoint can return 429 Too many requests\r\n. Suggest change it to chunk-style promises.

await Promise.all([...result.flat().map(downloadFile), ...chromeFiles.map(downloadChromeFile)]);

npm run validate:schemas

This may be the most critical issue.

When validating the latest fetched storage.json, I find that the json contains an entry at ~line 429 that breaks the current validation logic.

"session": {
    "allowedContexts": [
        "devtools"
    ],
    "$ref": "StorageAreaWithUsage",
    "description": "Items in the <code>session</code> storage area are kept in memory, and only until the either browser or extension is closed or reloaded.",
    "properties": {
        "QUOTA_BYTES": {
            "description": "The maximum amount of data (in bytes, currently at 10MB) that can be stored in session storage, as measured by the StructuredCloneHolder of every value plus every key's length."
        }
    }
}

Seems like value-less description-only properties json cannot pass the existing validation(?) Coz once I manually remove this QUOTA_BYTES entry, validation will work ok.

This is definitely a blocker for anyone who want to contribute fixes, and yet I am not sure what's the correct fix to make the validation works again. Can maintainer please take a look?

Ref: https://hg.mozilla.org/integration/autoland/raw-file/tip/toolkit/components/extensions/schemas/storage.json

Typechecking

Running tsc --noEmit in project level would result in error in src/fetch.ts. Potentially solvable by installing @types/got I think?

Solving this would definitely help for better IntelliSense on contributor-side.

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

No branches or pull requests

1 participant