Page MenuHomePhabricator

Live comment preview continually reloads Pholio's inline comments
Closed, WontfixPublic

Assigned To
Authored By
shadowhand
Oct 1 2014, 5:00 PM
Referenced Files
F221561: Screen_Shot_2014-10-20_at_15.21.41.png
Oct 20 2014, 7:22 PM
F221549: pasted_file
Oct 20 2014, 6:59 PM
F221543: pasted_file
Oct 20 2014, 6:59 PM
F221535: Screen_Shot_2014-10-20_at_14.09.35.png
Oct 20 2014, 6:20 PM
F211768: Screen_Shot_2014-10-02_at_10.35.18.png
Oct 2 2014, 3:36 PM
F211450: Screen_Shot_2014-10-01_at_10.44.38_AM.png
Oct 1 2014, 5:45 PM
F211448: Screen_Shot_2014-10-01_at_10.44.20_AM.png
Oct 1 2014, 5:45 PM
F211438: Screen_Shot_2014-10-01_at_12.37.55.png
Oct 1 2014, 5:41 PM

Description

When typing into the comment box on a mock or a diff, and inline comments have been added as well, each of the inline comments will also reload when the comment preview refreshes. This is particularly noticeable when on a slow connection and the inline comments have images attached. In a low-bandwidth environment, it actually causes additional bandwidth waste by triggering a refresh of images that have already been loaded.

Test: add inline comment to a diff or mock with image. Type into general comment box and watch as the image is refreshed as the comment preview is refreshed.

Expected: comment preview changes without reloading inline comments.

Actual: all comments, including inline comments and inline images, are refreshed.

Related Objects

Event Timeline

shadowhand raised the priority of this task from to Needs Triage.
shadowhand updated the task description. (Show Details)
shadowhand added a project: Phabricator.
shadowhand added subscribers: shadowhand, dkobia.
chad renamed this task from Live comment preview reloads inline comments to Live comment preview reloads in Pholio inline comments.Oct 1 2014, 5:15 PM
chad triaged this task as Low priority.
chad edited projects, added Pholio; removed Phabricator.
chad added a project: Remarkup.

It's not just Philio, but also Differential.

chad renamed this task from Live comment preview reloads in Pholio inline comments to Live comment preview continually reloads Pholio's inline comments.Oct 1 2014, 5:19 PM

I have triaged this into two different tasks. First is T1895 which covers all preview fields in Phabricator. Then this task, to be more specific about Pholio and even if preview is on, not re-fetching the images/comments.

Okay, so T1895 is somewhat related, but not completely. I fail to see how this is strictly about Pholio though, as the exact same problematic behavior (refreshing inline comments) can be seen in Differential.

It's way simpler to just reload everything, and the amount of bandwidth in the comment text is trivial, so we're unlikely to change that. It would only be impactful if you had a dialup connection or something.

The images should be getting cached, though. If they're not, that's a real bug.

However, I can't immediately reproduce this. Here's my browser making a bunch of previews without reloading images (note that the response is only 3KB, even when we pull in inline comments):

Screen_Shot_2014-10-01_at_10.31.22_AM.png (1×1 px, 218 KB)

What browser are you seeing this on?

@epriestley perhaps it only reloads when there are multiple images on a mock? I was not able to reproduce with a mock that only has one image and no revisions. Commenting on a mock that has multiple images and multiple revisions resulted in this (using Chrome):

Screen_Shot_2014-10-01_at_12.37.55.png (350×1 px, 106 KB)

Notice how the the one image is loaded multiple times, with 200 status not 304.

My assumption is Pholio's inline comments contain large images, and Differentials mostly just contain text. We might get Differential for free with this task, I'm not up to speed on that code to know.

Hmm, I can't repro in Chrome either. Does it repro on this install?

Here's the sort of comment + inlines I'm making:

Screen_Shot_2014-10-01_at_10.44.20_AM.png (1×1 px, 168 KB)

Here's the previews firing without asset reloads:

Screen_Shot_2014-10-01_at_10.44.38_AM.png (1×1 px, 207 KB)

And those are against M54, which has several images.

Also, I'm not sure what tool you're screenshotting, but are those definitely network requests (vs fills from local cache)? Are you visually seeing the images load, or just seeing these requests in a log and concerned about unnecessary bandwidth use?

@epriestley that's from Chrome Devtools (Network pane). They are definitely network requests and not cache. There would be a (from cache) and color change on the line item if it was cached.

I am not able to reproduce the same behavior on M54, which either means the issue is solved in a newer version of phab, or the issue does not appear on mocks that only have one revision.

I will update our local instance and see if the issue goes away. And FWIW, I'm not on dialup, but rather a 3G tether.

After upgrading to the latest version of code, I am still seeing the exact same behavior: when making an comment, the inline comment images are reloaded and are not cached:

Screen_Shot_2014-10-02_at_10.35.18.png (368×872 px, 119 KB)

Is that true even if you make a new mock with new comments (i.e., everything created after the upgrade)? We fixed several file permissions issues in the relatively recent past, but they are partially state-based and older files may not have the correct state.

@epriestley sorry it took a while to follow up on this, but it's still happening after the upgrade.

Video: http://quick.as/O3RJIlpX

Network requests, all 200 not 304...

Screen_Shot_2014-10-20_at_14.09.35.png (229×777 px, 55 KB)

Does it reproduce on this install for you @shadowhand?

My only thoughts are something server side (http) is causing the image to not cache in your browser? What do the response headers look like? Is the expiration in the future or past?

pasted_file (167×278 px, 31 KB)

I can't reproduce on this install either, here is a screenshot of me inspecting Network in Chrome in Pholio, 23 requests and roughly 29KB total. (1-2KB per js reload).

pasted_file (281×564 px, 104 KB)

When I have an image with an expiration in the past, it does cause us to reload the image each keystroke. I just can't replicate the issue with stock Phabricator.

@chad it must be a misconfiguration somewhere on our end... i see both a "no cache" header and a past date for "expires":

Screen_Shot_2014-10-20_at_15.21.41.png (118×425 px, 25 KB)

could it be a nginx issue?

Light grepping the source, I don't see us setting these headers in PHP. I'd check your server settings, it looks like nginx default is off. I'm not sure how this install is configured, maybe @epriestley knows.

In general I think setting these aggressively (like +1 month) should be fine. For static resources like css/js we bundle them with a hash so you won't have old bundles when you upgrade Phabricator.

We set these headers explicitly here:

https://secure.phabricator.com/diffusion/P/browse/master/src/aphront/response/AphrontResponse.php;d248bc47cf00005673d2b78bf4ff03eea1e2215c$107-134

If they aren't making it to the response, you might have some stronger setting in nginx overriding them. I'm not expert enough at nginx to know what to look for, though.

It looks like his headers match our if else statement when cacheable isn't set (date, etc). It looks like developer mode could trigger that, but I can't repro in my sandbox.

epriestley claimed this task.

We were never able to reproduce this and no one else has reported it in more than a year.