Cannot choose workstation on mobile

Bug #1789747 reported by Christopher Burton on 2018-08-29
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Unassigned
3.1
Medium
Unassigned

Bug Description

When trying to log into the staff web client on a mobile device, a dropdown for workstations shows even though no workstations have been assigned so it doesn't allow the creation of one either when trying to sign in.

This is occurring on 3.1.5 web client

Revision history for this message
Kathy Lussier (klussier) wrote :

Is this an iOS device? I just tested it on Android, but didn't see the problem.

Revision history for this message
Christopher Burton (cburton) wrote :

I have tested on every mobile browser I can think of. It works on my phone because I have a workstation saved in my cache but on any fresh browser (no cache) I can't sign in at all. BMagic confirmed with me he had the same issue as well

Revision history for this message
Christopher Burton (cburton) wrote :

Both android and iOS

Revision history for this message
Kathy Lussier (klussier) wrote :

I can confirm this bug on master and in 3.1.5. This worked as expected when I tested it yesterday on a 3.1.4 system.

Using an Android phone / Chrome browser that did not have a workstation stored in local storage, when I tried to access the web client login screen, I have a dropdown for the workstation selector, as Christopher described, with no workstations listed. The expectation is that no workstation selector appears here since we have no workstations set in local storage. It also immediately gives me a failed login message even though I have not yet attempted to log in. See the screenshot at http://www.screencast.com/t/XUPhwRGr

If I enter a user name and password, login fails, presumably because a workstation has not been selected.

The system I tested yesterday was running 3.1.4. I upgraded the system to 3.1.5. When I initially arrived at the login screen, my previously-configured workstation was available in the dropdown selector. After clearing local storage and the cache, I see the behavior described above.

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Bill Erickson (berick) wrote :

It's the shared workers added to fix the IndexedDB issues (bug #1775719).

At least, I have confirmed a similar-looking issue in desktop Safari.

The JS console reports:

undefined is not an object (evaluating 'service.worker.port')

https://caniuse.com/#feat=sharedworkers
https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker#Browser_compatibility

Not sure why Mozilla says it's supported in Chrome for Android, though.

Revision history for this message
Bill Erickson (berick) wrote :

The quickest fix would be to say we only support offline mode in Chrome and Firefox. With that we could add checks to avoid the login errors in Safari, etc.

BTW, I don't imagine shared web workers will be supported in Safari any time soon:

https://webkit.org/status/#feature-shared-web-workers

Revision history for this message
Bill Erickson (berick) wrote :

Correction: only support offline mode in *desktop* Chrome and Firefox.

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Here's a branch that gets Safari working again:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1789747-shared-workers-check

In addition to sanity checks, it disables the Offline Circulation menu option when SharedWorkers are not available (i.e the offline UI won't work).

I am still having issues with Chrome for Android, but I don't have the tuits at the moment to set up remote debugging and determine the issue. Curious what others see.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Christopher Burton (cburton) wrote :

Still getting a couple errors with Safari after applying the fix.

[Log] egAuth found no valid authtoken (core.bundle.js, line 1)

[Debug] egStartup.expiredAuthHandler() (core.bundle.js, line 1)

[Error] SharedWorker() not supported – ReferenceError: Can't find variable: SharedWorker — core.bundle.js:1:56337
ReferenceError: Can't find variable: SharedWorker — core.bundle.js:1:56337

[Error] undefined is not an object (evaluating 'o.worker.port')
https://test.nflibrary.ca/js/ui/default/staff/build/js/core.bundle.js:1 – "<div ng-view=\"\" class=\"ng-scope\">"

Revision history for this message
Bill Erickson (berick) wrote :

Hi Christopher, the first 3 log entries are fine. The final message should no longer appear.

As part of my patch, the "SharedWorker() not supported" message was changed from an 'error' to a 'warn' in the log. This suggests to me the patch was not successfully applied/built or you need to force-clear your browser cache.

Revision history for this message
Christopher Burton (cburton) wrote :

Is there anything that requires a restart after applying it?
It wouldn't, right? Because it is all Javascript modifications.

I cleared my Safari cache and still having the errors so I am going to double check the patch application I did Friday on our test server and will re-update

Revision history for this message
Bill Erickson (berick) wrote :

No restarts are required, but you will have to "npm run build" in Open-ILS/web/js/ui/default/staff before reinstalling the files.

Revision history for this message
Christopher Burton (cburton) wrote :

Thanks to Berick, I have successfully applied the patch and resolved workstation selection.

Although, now Register Patrons is not loading in the same browsers that had the SharedWorker issue. Checked on Mobile Chrome, Safari (Both mobile and desktop)

This exists @ /eg/staff/circ/patron/register

Possibly unhandled rejection: undefined
vendor.bundle.js:2315

Bill Erickson (berick) on 2018-09-04
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

I've added some additional sanity checks to the offline caching code to resolve the patron register errors noted above.

Pushed to same branch, but the branch has been rebased to (a busy) master.

==

As an aside, I noticed while testing that expire dates are not parsing in Safari, leading to console errors, because it's implementation of Date.parse dislikes time zones like "-0400" -- it prefers "-04:00".

Revision history for this message
Christopher Burton (cburton) wrote :

Same error vendor.bundle.js:6:47851

function Tt(){
this.$get = ["$log", function(e) {

}

Revision history for this message
Christopher Burton (cburton) wrote :

Submitted that too early but this is the function still returning an error.
Same position as before but I think the error above is for the minified line

Revision history for this message
Christopher Burton (cburton) wrote :

I notice when building the bundle with npm though that offline-db-worker is returning 404

04 09 2018 16:19:53.723:WARN [web-server]: 404: /js/ui/default/staff/offline-db-worker.js

It exists in that location in Open-ILS/web/ but doesn't find it

Revision history for this message
Bill Erickson (berick) wrote :

Christopher, if your last comment is referring to 'npm run test' then then inability to load offline-db-worker.js is OK (and expected).

Bill Erickson (berick) on 2018-09-27
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Katie Greenleaf Martin (katiegmartin) wrote :

This is still affecting us in 3.1.5 on Chrome on iOS devices AND android devices. It does appear to work on Firefox on Android but requires a fresh install.

Revision history for this message
Kathy Lussier (klussier) wrote :

Bill - Should this bug have a pullrequest?

Revision history for this message
Scott Thomas (scott-thomas-9) wrote :

I tested Firefox on iOS, and the problem occurs.

Revision history for this message
Bill Erickson (berick) wrote :

I have added a pullrequest for my branch. Regardless of whether it fixes all the things, I think it's a good thing to have, because it performs various sanity checks which should have been added anyway. And when last tested, it allowed me to login to Safari, which I could not do before.

tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.2.0
milestone: 3.2.0 → none
milestone: none → 3.2.1
Changed in evergreen:
milestone: 3.2.1 → 3.2.2
Revision history for this message
Rogan Hamby (rogan-hamby) wrote :

Worked for Safari for me as well, signoff at user/rogan/lp1789747_no_workstation_on_mobile

Galen Charlton (gmc) on 2018-11-05
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

I've pushed the branch to master, rel_3_2, and rel_3_1. I've also pushed a follow-up to ensure that the offline circulation menu item gets fully disabled (as otherwise, one could still click on it).

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers