Uploaded image for project: 'SimplyE 2.0'
  1. SimplyE 2.0
  2. SIMPLY-3635

A profile-related download bug exists

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: High High
    • None
    • Android

      In LFA builds, downloads are failing on the second profile in the app. Verbatim copied steps to reproduce:

      09:45 open an app, create a profile
      09:45 enter the app, everything loads fine (edited) 
      09:45 download a book, fine
      09:45 logout and create a new profile and login with it
      09:45 catalog loads fine
      09:45 but when you try and download a book, ! success
      09:45 logout
      09:46 delete the first user you created
      09:46 login with the remaining user
      09:46 try and download a book, ! success
      09:46 exit the app
      09:46 start the app
      09:46 select the profile, catalog loads fine, and now downloading a book works
      

      It sounds to me like something in the borrowing code is holding a reference to a profile and is then using the wrong one when performing a download.

      Note: This ticket is being worked on outside of NYPL hours.

      Stack trace:

      2021-03-19 13:45:53.485 21035-21110/one.lfa.android.app.indigenous D/org.nypl.simplified.taskrecorder.api.TaskRecorder: step started: Locating profile d13f73f5-2f23-4f5b-80f8-0b0a33f3bfc7...
      2021-03-19 13:45:53.487 21035-21110/one.lfa.android.app.indigenous D/org.nypl.simplified.taskrecorder.api.TaskRecorder: step started: Locating account 13af2a93-23c2-45cf-910b-52ff67c1b53c in the profile...
      2021-03-19 13:45:53.492 21035-21110/one.lfa.android.app.indigenous E/org.nypl.simplified.books.borrowing.BorrowTask: [e96a8216] [e96a8216]: failed to find account: 
          org.nypl.simplified.accounts.database.api.AccountsDatabaseNonexistentException: Nonexistent account: 13af2a93-23c2-45cf-910b-52ff67c1b53c
              at org.nypl.simplified.profiles.Profile.account(Profile.kt:71)
              at org.nypl.simplified.books.borrowing.BorrowTask.findAccount(BorrowTask.kt:318)
              at org.nypl.simplified.books.borrowing.BorrowTask.executeStart(BorrowTask.kt:139)
              at org.nypl.simplified.books.borrowing.BorrowTask.execute(BorrowTask.kt:96)
              at org.nypl.simplified.books.controller.Controller$bookBorrow$1.call(Controller.kt:577)
              at org.nypl.simplified.books.controller.Controller$bookBorrow$1.call(Controller.kt:84)
              at org.nypl.simplified.books.controller.Controller$submitTask$2.run(Controller.kt:282)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
              at org.nypl.simplified.threads.NamedThreadPools$namedThreadPoolFactory$1$newThread$t$1.run(NamedThreadPools.kt:51)
              at java.lang.Thread.run(Thread.java:764)
      

            markraynsford Mark Raynsford
            markraynsford Mark Raynsford
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: