freelawproject / recap

This repository is for filing issues on any RECAP-related effort.
https://free.law/recap/
12 stars 4 forks source link

Two JavaScript errors #298

Closed comex closed 1 year ago

comex commented 3 years ago

I noticed two JavaScript errors while visiting the 11th Circuit PACER site with RECAP. I'm not sure if these led to anything actually behaving wrong, though I don't see any RECAP UI on these pages.

The first one happened on both "Download Confirmation" and "N Documents are attached to this filing" pages:

TypeError: Cannot read property 'caseId' of undefined

I lost the full error message, but it was pointing to this code from content_delegate.js:

  const tabStorage = await getItemsFromStorage(this.tabId)
  this.pacer_case_id = this.pacer_case_id ? this.pacer_case_id : tabStorage.caseId;

The second one happened after I clicked on "Accept Charges and Retrieve" and was looking at a PDF in Chrome's PDF viewer:

content_delegate.js:267 Uncaught (in promise) TypeError: Cannot read property 'insertBefore' of null
    at ContentDelegate.handleDocketDisplayPage (content_delegate.js:267)

pointing to

  const tableBody = document.querySelector('tbody');
  const tr = createAlertButtonTr();
  tableBody.insertBefore(tr, tableBody.childNodes[0]);
mlissner commented 3 years ago

Thanks for this. The appellate code is pretty rough and isn't really released. There's a good chance we'll throw it out and start over, actually, but it's good to have things logged, thank you for this.

mlissner commented 1 year ago

@ERosendo flagging this for you too, since it's another in-the-wild appellate bug. Like the other one, I don't know if it's relevant or not and I don't know if we can reproduce it or not, but it's worth at least looking at carefully as we're working on appellate PACER.

ERosendo commented 1 year ago

I uploaded two cases from the 11th circuit (21-13663 and 21-12729) using the latest code for the extension, but I was not able to reproduce these errors.

I think the extension showed these errors because the previous implementation of the extension was trying to use the same class to handle pages from district courts and appellate courts. The current implementation uses a different class for Appellate pacer.

@mlissner We should close this issue. The methods that handle the attachment page(handleAttachmentPage) and the download confirmation page(handleSingleDocumentPageView) in the appellateDelegate class fix these errors.

mlissner commented 1 year ago

Thanks. @comex if you see other issues in the latest code (which will be deployed in the next couple weeks), let us know and thank you again for filing this bug.