-
Bug
-
Resolution: Done
-
High
-
None
When a patron's library has more than one OverDrive collection, OverdriveAPI will connect to the Patron API using the wrong bearer token.
If an unexpired Overdrive Credential is available, OverdriveAPI.get_patron_credential returns it, regardless of the Collection associated with the OverdriveAPI. If no Credential is available, then it is created based on the associated Collection.
This can lead to strange results in, for example, CirculationAPI.sync_bookshelf, since the remote checkouts and holds API calls will return the same duplicated but valid results of the credentialed collection for each OverDrive collection. That, in turn, results in underlying CirculationAPI.patron_activity completing successfully (complete=True), at which point any local loans/holds associate with any but the credentialed OverDrive collection being removed.