iOS - JS Error: Mobile Search page: undefined is not an object

Description

Context

undefined is not an object (evaluating 'document.getElementsByClassName('course-card')[0].innerText')

These errors began to grow starting Sept. 6 at 11 PM Eastern time. They are coming from /webview/search and occurring about 700 times an hour on Mobile, less often on desktop. See the NR 3 day view.

Implementation Details

This appears to be caused by https://github.com/edx/edx-app-ios/blob/cae242054f66c84a252fc8167a8909531a13d825/Source/DiscoveryWebViewHelper.swift#L297 , part of an e2e test that was relying on a certain class name being there in the course cards. The test should either be updated to the correct classname based on the new prospectus page, or, ideally, not dependent on executing JS in the DOM at all.

Epic Link

None

Activity

Show:
Saeed Bashir
February 22, 2021, 10:26 AM

We had completely removed the JS evaluation code from the iOS codebase, and rolled out the fix in 2.24.1, so the only chances are it is coming from the older versions of the app.

Is there a way to check which app versions are reporting this issue on New Relic? cc

Colin Brash
February 21, 2021, 3:35 AM

any immediate thoughts about what is going on? Seems like we need to reopen this.

cc let’s discuss what we know about the impact on Monday and see if we want to inject or schedule for the next sprint.

albemarle
February 19, 2021, 8:57 PM

Two months later we are still seeing this about 25 times per hour. I would have expected adoption of the fixed version to be nearly-total by now. Is there a chance this is happening in another spot in the codebase as well?

albemarle
December 21, 2020, 7:17 PM

Great , thank you!

Colin Brash
December 21, 2020, 6:42 PM

Thanks - the fix for this was just released to the App Store about 12 hours ago (2.24.1). We should see the errors decrease as users start to adopt this new version over the next couple days. If this still seems to be happening at the same frequency tomorrow, we’ll take a deeper look.

Priority

CAT-2

Assignee

Saeed Bashir

Fix versions

Sprint

None

Labels

None

Story Points

1

Reporter

albemarle