Closed Bug 1039756 Opened 10 years ago Closed 10 years ago

[spartacus] user_hash is sometimes empty (cannot start payment)

Categories

(Marketplace Graveyard :: Payments/Refunds, defect)

Avenir
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kumar, Assigned: scolville)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Attached file spa.txt
I got to a successful payment screen once but now I seem to get caught in a state where user_hash has not been set. My STR is like this:

- install Payments Alt packaged app on device
- search private yacht
- purchase the yacht
- enter PIN

Then I see PROVIDER_LOGOUT_FAIL but the error in the log before that is USER_HASH_EMPTY.

I don't know if this is from repeated attempts or not. Maybe this code isn't running? https://github.com/mozilla/spartacus/blob/master/public/js/lib/auth.js#L61

Attaching a logcat
Blocks: 837289
Whiteboard: [qa-]
Assignee: nobody → scolville
Status: NEW → ASSIGNED
The problem is caused by us not having a user_hash when persona just fires onReady and not onLogin.

In webpay we just prepareSim in that case. https://github.com/mozilla/webpay/blob/master/media/js/pay/pay.js#L133

Here's a prospective fix that sets app.session.user_hash to false when onReady is fired that way we can look at the value and if it's explicitly false (the default is null) we can then just do prepareSim and not prepareAll (which requires the user_hash).

https://github.com/mozilla/spartacus/pull/93
https://github.com/mozilla/spartacus/commit/8282044119958cd8e98c6f2c0ab033df1939e7cd
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: