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

rustdoc JS does not handle NO_DEVICE_SPACE error #81928

Closed
lovasoa opened this issue Feb 9, 2021 · 5 comments · Fixed by #81964
Closed

rustdoc JS does not handle NO_DEVICE_SPACE error #81928

lovasoa opened this issue Feb 9, 2021 · 5 comments · Fixed by #81964
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Feb 9, 2021

Problem

No documented item appear in documentation pages anywhere after a localStorage error.

image

(the page should render like that instead)

After localStorage raises a NS_ERROR_FILE_NO_DEVICE_SPACE error, all documentation page appear entirely blank. Freeing up space doesn't solve the isssue.

The following appears in the browser console :

Uncaught 
Exception
​
columnNumber: 0
​
data: null
​
filename: "https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js"
​
lineNumber: 1
​
message: ""
​
name: "NS_ERROR_FILE_NO_DEVICE_SPACE"
​
result: 2152857616
​
stack: "getCurrentValue@https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1:1802\ngetSettingValue@https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1:490\n@https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1:711\n"
​
<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
storage-20210124-1.51.0-nightly-1d0d76f8d.js:1
    getCurrentValue https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1
    getSettingValue https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1
    <anonymous> https://docs.rs/storage-20210124-1.51.0-nightly-1d0d76f8d.js:1

Steps

  1. Fill the disk firefox uses for localStorage
  2. open any documentation page on docs.rs : the documentation doesn't appear
  3. Free up space
  4. open any documentation page on docs.rs : the documentation still doesn't appear

Possible Solution(s)

Opening the docs in a private browsing window works.

@Eh2406
Copy link
Contributor

Eh2406 commented Feb 9, 2021

Is this an issue with docs.rs, or with cargo doc or with an editor? Lets figure out which repo this report belongs in.

@lovasoa
Copy link
Contributor Author

lovasoa commented Feb 9, 2021

I think the problem is in the javascript generated by cargo doc which misses a try { ... } catch(e) { ... } statement around localStorage calls.

@Eh2406 Eh2406 transferred this issue from rust-lang/cargo Feb 9, 2021
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 9, 2021
@jyn514 jyn514 changed the title cargo doc : "Loading content" forever rustdoc JS does not handle NO_DEVICE_SPACE error Feb 9, 2021
@lovasoa
Copy link
Contributor Author

lovasoa commented Feb 10, 2021

Where is the JavaScript source for the the cargo documentation ? Maybe I can attempt a PR myself?

@Eh2406
Copy link
Contributor

Eh2406 commented Feb 10, 2021

JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 11, 2021
Fix documentation not showing on localStorage error

Fixes rust-lang#81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 11, 2021
Fix documentation not showing on localStorage error

Fixes rust-lang#81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 11, 2021
Fix documentation not showing on localStorage error

Fixes rust-lang#81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 12, 2021
Fix documentation not showing on localStorage error

Fixes rust-lang#81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 12, 2021
Fix documentation not showing on localStorage error

Fixes rust-lang#81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()
@bors bors closed this as completed in f13bbea Feb 12, 2021
@lovasoa
Copy link
Contributor Author

lovasoa commented Feb 12, 2021

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants