The default bug view has changed. See this FAQ.

use v2 user info with YSI to get storage values

RESOLVED FIXED in Thunderbird 15.0

Status

Thunderbird
Message Compose Window
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Tracking

unspecified
Thunderbird 15.0

Thunderbird Tracking Flags

(thunderbird13 fixed, thunderbird14 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
Created attachment 617773 [details] [diff] [review]
fix ysi component

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.
(Assignee)

Comment 1

5 years ago
Created attachment 617973 [details] [diff] [review]
fix mozmill test

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)

Updated

5 years ago
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
Blocks: 744010
(Assignee)

Comment 3

5 years ago
(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-
Created attachment 618708 [details] [diff] [review]
Old patch plus code to fix stale token handler for YouSendIt

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)
(Assignee)

Comment 6

5 years ago
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?
(Assignee)

Updated

5 years ago
Attachment #618708 - Flags: approval-comm-beta?
Attachment #618708 - Flags: approval-comm-beta+
Attachment #618708 - Flags: approval-comm-aurora?
Attachment #618708 - Flags: approval-comm-aurora+
http://hg.mozilla.org/comm-central/rev/def8ce3a54c2
http://hg.mozilla.org/releases/comm-aurora/rev/40be833f1bc6
http://hg.mozilla.org/releases/comm-beta/rev/15288695dfda
Status: NEW → RESOLVED
Last Resolved: 5 years ago
status-thunderbird13: --- → fixed
status-thunderbird14: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 15.0
You need to log in before you can comment on or make changes to this bug.