Closed Bug 748215 Opened 12 years ago Closed 12 years ago

use v2 user info with YSI to get storage values

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
normal

Tracking

(thunderbird13 fixed, thunderbird14 fixed)

RESOLVED FIXED
Thunderbird 15.0
Tracking Status
thunderbird13 --- fixed
thunderbird14 --- fixed

People

(Reporter: Bienvenu, Assigned: Bienvenu)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch fix ysi component (obsolete) — Splinter Review
we should use v2 of the YSI user info command in order to get storage numbers. This patch does that. I think we need to tweak the fake ysi server to return the same kind of info.
Attached patch fix mozmill test (obsolete) — Splinter Review
I left the check for null storage in there just in case YSI does something different than I expect.

I changed the error code we check for because now it's 401, not 500, in the case of stale auth tokens.

YSI is still returning 0 for the storage used but I believe they'll fix that.
Attachment #617773 - Attachment is obsolete: true
Attachment #617973 - Flags: review?(mconley)
OS: Windows 7 → All
Hardware: x86_64 → All
David:

The code looks good, but upon testing, I'm getting the same issue you were getting before:

2012-04-25 11:22:49	YouSendIt	INFO	request status = 200 response = {"key":null,"id":null,"type":null,"policy":null,"version":null,"password":null,"role":null,"email":null,"firstname":null,"lastname":null,"created":null,"account":null,"storage":null,"status":null,"errorStatus":{"message":"Login session may have timed out. Please try logging again.","code":401}}

What's the story with that?

-Mike
(In reply to Mike Conley (:mconley) from comment #2)
> David:
> 
> The code looks good, but upon testing, I'm getting the same issue you were
> getting before:
> 
> 2012-04-25 11:22:49	YouSendIt	INFO	request status = 200 response =
> {"key":null,"id":null,"type":null,"policy":null,"version":null,"password":
> null,"role":null,"email":null,"firstname":null,"lastname":null,"created":
> null,"account":null,"storage":null,"status":null,"errorStatus":{"message":
> "Login session may have timed out. Please try logging again.","code":401}}
> 
> What's the story with that?
> 
Is it failing to authenticate? Or do we refresh the token?

The only thing I can figure is that if you've done a v1 user info with a token, doing a v2 user info with that same token fails.
Comment on attachment 617973 [details] [diff] [review]
fix mozmill test

Review of attachment 617973 [details] [diff] [review]:
-----------------------------------------------------------------

r-'ing because in nsYouSendIt.js, that block inside the conditional on line 272 will never be executed (since it checks for an impossibility, considering the block that it's contained within).
Attachment #617973 - Flags: review?(mconley) → review-
I was wrong about my last review - I got confused between request.status and docResponse.errorStatus.  So r+ for bienvenu's work.

In my testing, I noticed that if we didn't have the YSI password stored in nsILoginManager, then attempting to re-auth when tokens have gone stale would always hit the failure case, since the old token was not being cleared out.
Attachment #617973 - Attachment is obsolete: true
Attachment #618708 - Flags: review?(dbienvenu)
Comment on attachment 618708 [details] [diff] [review]
Old patch plus code to fix stale token handler for YouSendIt

thx for the additional fix!
Attachment #618708 - Flags: review?(dbienvenu) → review+
Comment on attachment 618708 [details] [diff] [review]
Old patch plus code to fix stale token handler for YouSendIt

I think we'll want to switch TB 13 / 14 over to this API as well.

This'll clear the way for displaying the YSI usage graph - assuming they start delivering some real numbers soon.
Attachment #618708 - Flags: approval-comm-beta?
Attachment #618708 - Flags: approval-comm-aurora?
Attachment #618708 - Flags: approval-comm-beta?
Attachment #618708 - Flags: approval-comm-beta+
Attachment #618708 - Flags: approval-comm-aurora?
Attachment #618708 - Flags: approval-comm-aurora+
You need to log in before you can comment on or make changes to this bug.