[email/IMAP] upgrade browserbox and imap-handler libs to get IMAP protocol logging

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: asuth, Assigned: asuth)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
https://github.com/whiteout-io/browserbox/pull/50 and its friend https://github.com/whiteout-io/imap-handler/pull/11 added support for generating a variant of IMAP protocol strings with sensitive/chatty contents removed.  Pretty much my only regret from our upgrade to email.js was the loss of protocol logging, this nicely fixes it.

Per previous discussion with mcav about taking upstream changes, I believe my review is sufficient here, although I would check more if there were potentially risky/bit-rotty changes in the diff.  (Our discussion was more about my contributed changes to upstream reviewed by upstream.)   Other than logging, the changes are mainly a standardization of single-quotes for strings over double-quotes, improved support for promises in the API, support for "precheck" steps for operations, and a minor change to how IDLE is terminated.


I'm not changing how we integrate browserbox logging, so this still only turns on when we crank the debug up to the privacy entraining level.  Here's an example trace from my yahoo.com test account connecting to grab some snippets:
===
WLOG: [slog] browserbox {"msg":"[1] connecting to imap.mail.yahoo.com:993"}
WLOG: [slog] browserbox {"msg":"[1] entering state: false"}
WLOG: [slog] browserbox {"msg":"[1] tcp socket opened"}
WLOG: [slog] browserbox {"msg":"[1] S: * OK [CAPABILITY IMAP4rev1 ID NAMESPACE X-ID-ACLID UIDPLUS LITERAL+ CHILDREN XAPPLEPUSHSERVICE XYMHIGHESTMODSEQ AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2 AUTH=XYMCOOKIE AUTH=XYMECOOKIE AUTH=XYMCOOKIEB64 AUTH=XYMPKI] IMAP4rev1 imapgate-1.8.1_01.61594 imap510.mail.ne1.yahoo.com"}
WLOG: [slog] browserbox {"msg":"[1] session: connection established"}
WLOG: [slog] browserbox {"msg":"[1] entering state: 1"}
WLOG: [slog] browserbox {"msg":"[1] C: W1 ID (\"vendor\" \"Mozilla\" \"name\" \"GaiaMail\" \"version\" \"0.2\" \"support-url\" \"(* 33B string *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: * ID (\"name\" \"imapgate\" \"version\" \"1.8.1_01.61594\" \"support-url\" \"(* 22B string *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W1 OK completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W2 login \"(* 21B string *)\" \"(* value hidden *)\""}
WLOG: [slog] browserbox {"msg":"[1] S: W2 OK AUTHENTICATE completed - Mailbox size in bytes is 201768456"}
WLOG: [slog] browserbox {"msg":"[1] entering state: 2"}
WLOG: [slog] browserbox {"msg":"[1] C: W3 CAPABILITY"}
WLOG: [slog] browserbox {"msg":"[1] S: * CAPABILITY IMAP4rev1 ID NAMESPACE X-ID-ACLID UIDPLUS LITERAL+ XAPPLEPUSHSERVICE XYMHIGHESTMODSEQ"}
WLOG: [slog] browserbox {"msg":"[1] S: W3 OK CAPABILITY completed"}
WLOG: [slog] browserbox {"msg":"[1] post-auth capabilites updated: IMAP4REV1,ID,NAMESPACE,X-ID-ACLID,UIDPLUS,LITERAL+,XAPPLEPUSHSERVICE,XYMHIGHESTMODSEQ"}
WINF: [slog] imap:connected {"hostname":"imap.mail.yahoo.com","port":"993","crypto":"ssl"}
WLOG: [slog] browserbox {"msg":"[1] C: W4 SELECT \"INBOX\""}
WLOG: [slog] browserbox {"msg":"[1] S: * 12096 EXISTS"}
WLOG: [slog] browserbox {"msg":"[1] S: * 0 RECENT"}
WLOG: [slog] browserbox {"msg":"[1] S: * OK [UIDVALIDITY 1334878262] UIDs valid"}
WLOG: [slog] browserbox {"msg":"[1] S: * OK [UIDNEXT 15548] Predicted next UID"}
WLOG: [slog] browserbox {"msg":"[1] S: * FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded $Junk $NotJunk)"}
WLOG: [slog] browserbox {"msg":"[1] S: * OK [PERMANENTFLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded $Junk $NotJunk)] Permanent flags"}
WLOG: [slog] browserbox {"msg":"[1] S: * OK [HIGHESTMODSEQ 6119477263925486680]"}
WLOG: [slog] browserbox {"msg":"[1] S: W4 OK [READ-WRITE] SELECT completed; now in selected state"}
WLOG: [slog] browserbox {"msg":"[1] entering state: 3"}
WLOG: [slog] browserbox {"msg":"[1] C: W5 UID FETCH 15529 BODY.PEEK[1.1]<0.2615>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12087 FETCH (UID 15529 BODY[1.1]<0> \"(* 523B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W5 OK UID FETCH completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W6 UID FETCH 15529 BODY.PEEK[2]<0.725>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12087 FETCH (UID 15529 BODY[2]<0> \"(* 145B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W6 OK UID FETCH completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W7 UID FETCH 15530 BODY.PEEK[1.2]<0.13945>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12088 FETCH (UID 15530 BODY[1.2]<0> \"(* 2789B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W7 OK UID FETCH completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W8 UID FETCH 15530 BODY.PEEK[2]<0.725>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12088 FETCH (UID 15530 BODY[2]<0> \"(* 145B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W8 OK UID FETCH completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W9 UID FETCH 15531 BODY.PEEK[1.2]<0.4096>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12089 FETCH (UID 15531 BODY[1.2]<0> \"(* 4096B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W9 OK UID FETCH completed"}
WLOG: [slog] browserbox {"msg":"[1] C: W10 UID FETCH 15532 BODY.PEEK[1.2]<0.4096>"}
WLOG: [slog] browserbox {"msg":"[1] S: * 12090 FETCH (UID 15532 BODY[1.2]<0> \"(* 4096B literal *)\")"}
WLOG: [slog] browserbox {"msg":"[1] S: W10 OK UID FETCH completed"}
WLOG: [slog] mailslice:mutex-released {"folderId":"0/0","err":null}
WLOG: runOp_end(do: {"type":"downloadBodies","longtermId":"0/3","lifecycle":"done","localStatus":"done","serverStatus":"done","tryCount":0,"humanOp":"downloadBodies","messages":[{")
===

Attaching the patch as soon as I have a bug number.
Created attachment 8568794 [details] [review]
[gaia-email-libs-and-more] asutherland:email-imap-logging > mozilla-b2g:master
Created attachment 8568835 [details] [review]
[gaia] asutherland:email-imap-logging > mozilla-b2g:master
(Assignee)

Updated

4 years ago
Attachment #8568835 - Flags: review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed

Updated

4 years ago
Keywords: checkin-needed
(Assignee)

Updated

4 years ago
Assignee: nobody → bugmail
Status: NEW → ASSIGNED

Updated

4 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.