Rocket.chat: The new Lazy load image attachments doesn't work

Created on 28 May 2018  路  18Comments  路  Source: RocketChat/Rocket.Chat

Description:

According to #10608, our instance of RC doesn't show the image when we point at it. Is there a way to disable this Lazy load feature?

Server Setup Information:

  • Version of Rocket.Chat Server: 0.65.0
  • Operating System: Ubuntu 16.04.1 LTS
  • Deployment Method(snap/docker/tar/etc): docker (official rocketchat/rocket.chat)
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Disabled
  • Node Version: n/a
  • mongoDB Version: n/a

Steps to Reproduce:

  1. Upload image

Expected behavior:

Point at the preview image to see the real image

Actual behavior:

Nothing happened when pointing the preview image
screen shot 2561-05-28 at 10 25 55

Relevant logs:

n/a

bug

Most helpful comment

My workaround is adding this script to Custom Script for Logged In Users in Layout

setInterval(function() {
    document.querySelectorAll(".attachment-image .lazy-img").forEach(function(el) { 
        el.src = el.dataset.src;
        el.removeAttribute('data-src');
        el.className = el.className.replace('lazy-img', '');
    })
}, 1000)

screen shot 2561-05-30 at 11 39 32

Thanks @ggazzo for the script. 馃憤

All 18 comments

@teamsoo could you check if you have some error on your console? We will think in a way to disable, but would be useful to fix this problem.

@ggazzo Hi, thanks for the response. I'm seeing this error when scrolling pass the preview image. Not sure if it's related.

screen shot 2561-05-28 at 12 28 57

yeah. I believe they're related.

a=e.firstNode.getBoundingClientRect();if(a.top>=-100&&a.left>=0&&a.top<=(window.innerHeight||document.documentElement.clientHeight))return l(e)})};window.addEventListener("resize",window.lazyloadtick);

got same error after upgrade to 0.65.0

I saw this issue too. I did a bunch of testing and it seems to work fine up until the point that this PR is merged - https://github.com/RocketChat/Rocket.Chat/pull/10887

It seems to work OK, but then once you merge that particular PR in, the images will not fully load and stay blurry

@ggazzo FYI

You don't have permission to use this label bug

@rocket-cat label add "type: bug"

i can confirm this

sorry guys, nrr template I'm working to fix it

I have same issue on my site.. please fix - I can't even roll back to 64
image

i have docker build and the above still an issue

Can confirm. I updated from 0.64.2 to 0.65.0, I'm also getting this issue.

Is there any way to put in the fix while being on snap without waiting for the next candidate release?

Editing Snaps is usually difficult. You can try these tips: https://askubuntu.com/questions/919091/why-snap-files-cannot-be-modified-in-any-way
Otherwise, you'll have to clone the fixed branch and import your data.

This should _really_ be a hotfix though. Not every team can afford having to switch to a local build...

can we confirm on the ETA for next release please???

I also see this on 0.65.0 since I upgraded it last night.

I agree on the hotfix part. Can't roll back to 64.2 either, site wont come up with it.

My workaround is adding this script to Custom Script for Logged In Users in Layout

setInterval(function() {
    document.querySelectorAll(".attachment-image .lazy-img").forEach(function(el) { 
        el.src = el.dataset.src;
        el.removeAttribute('data-src');
        el.className = el.className.replace('lazy-img', '');
    })
}, 1000)

screen shot 2561-05-30 at 11 39 32

Thanks @ggazzo for the script. 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brendanheywood picture brendanheywood  路  3Comments

karlprieb picture karlprieb  路  3Comments

djeber picture djeber  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments

Buzzele picture Buzzele  路  3Comments