Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageList long loading logs #4180

Merged
merged 6 commits into from Jul 6, 2020

Conversation

chrisbobbe
Copy link
Contributor

@chrisbobbe chrisbobbe commented Jul 1, 2020

To help debugging #4156; see also discussion around https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4156.20Message.20List.20placeholders/near/921700, where we'll have the debugging conversations.

@chrisbobbe chrisbobbe requested a review from gnprice July 1, 2020 20:13
@gnprice
Copy link
Member

gnprice commented Jul 6, 2020

Thanks @chrisbobbe !

I'm about to merge this, in the interest of getting out a beta today that will help debug #4156. As you say in the last commit message, though, it'd be good to structure that logging code a bit better. A few thoughts:

  • The log-long-load state and all the logic referring to that state could be encapsulated in a class, with an instance created at toplevel (where the setTimeout(maybeLogLongLoad, …) is now.)
  • The logic added to handleMessageEvent could then be one line just invoking a method on that instance, just passing uevent.
  • The map callback that produces loggableEvents could be pulled out and given a name like scrubUpdateEvent -- then logLongLoad would be much shorter.
  • In that map callback, I think it's more robust (even though it's a bit more boilerplate) to have each case name all the properties it's passing through, rather than say ...rest. In particular this means that if we add a new property to one of these, it doesn't get logged until we explicitly consider how to handle it.
    • A related illustration, perhaps: in the typing case I think the placeholdersDivTagFromContent will always just return null, because the typing content is focused on just the typing-status elements. Probably the boolean content !== '' is as much information from that as could be useful, but also there wouldn't be much lost by just omitting it entirely.

`mixed` is too general and implies that it could be something that's
not JSONable. We could just use JSONable, but in the one place we
emit these events, it's an `Error`. [1]

[1]: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4156.20Message.20List.20placeholders/near/921072.
For sending warnings from within the WebView outwards.
In steady state, these changes should be reverted or structured a
bit better; it feels a bit haphazard.

If the placeholders are still visible after 10 seconds, send a log
to Sentry with all the events the WebView has received, with
timestamps of receipt. Redact any `auth` fields by replacing the
value with "redacted", and redact any `content` fields by extracting
just the opening tag for the "message-loading" div so we can see if
it has the "hidden" class.

But we want to debug zulip#4156 ASAP,

[1]: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4156.20Message.20List.20placeholders/near/921700
@gnprice gnprice merged commit 523b307 into zulip:master Jul 6, 2020
@chrisbobbe
Copy link
Contributor Author

Cool, thanks for those suggestions!

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jul 17, 2020
See 523b307 (reverted in a recent commit) for an earlier attempt
at this. It was done quickly to debug a problem with minimal delay;
this is the better-organized version of it, informed by Greg's
suggestions [1].

[1]: zulip#4180 (comment)
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jul 17, 2020
See 523b307 (reverted in a recent commit) for an earlier attempt
at this. It was done quickly to debug a problem with minimal delay;
this is the better-organized version of it, informed by Greg's
suggestions [1].

[1]: zulip#4180 (comment)
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jul 20, 2020
See 523b307 (reverted in a recent commit) for an earlier attempt
at this. It was done quickly to debug a problem with minimal delay;
this is the better-organized version of it, informed by Greg's
suggestions [1].

[1]: zulip#4180 (comment)
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jul 21, 2020
See 523b307 (reverted in a recent commit) for an earlier attempt
at this. It was done quickly to debug a problem with minimal delay;
this is the better-organized version of it, informed by Greg's
suggestions [1].

[1]: zulip#4180 (comment)
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this pull request Jul 22, 2020
See 523b307 (reverted in a recent commit) for an earlier attempt
at this. It was done quickly to debug a problem with minimal delay;
this is the better-organized version of it, informed by Greg's
suggestions [1].

[1]: zulip#4180 (comment)
@chrisbobbe chrisbobbe deleted the pr-msglist-loading-logs branch November 6, 2020 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants