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

The new Lazy load image attachments doesn't work #10895

Closed
teamsoo opened this issue May 28, 2018 · 18 comments · Fixed by #10904
Closed

The new Lazy load image attachments doesn't work #10895

teamsoo opened this issue May 28, 2018 · 18 comments · Fixed by #10904

Comments

@teamsoo
Copy link

teamsoo commented May 28, 2018

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

@ggazzo
Copy link
Member

ggazzo commented May 28, 2018

@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.

@teamsoo
Copy link
Author

teamsoo commented May 28, 2018

@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

@teamsoo
Copy link
Author

teamsoo commented May 28, 2018

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);

@ppcat
Copy link

ppcat commented May 28, 2018

got same error after upgrade to 0.65.0

@JSzaszvari
Copy link
Contributor

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 - #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

@rocket-cat
Copy link

rocket-cat bot commented May 28, 2018

You don't have permission to use this label bug

@JSzaszvari
Copy link
Contributor

@rocket-cat label add "type: bug"

@rocket-cat rocket-cat bot added the type: bug label May 28, 2018
@traxanos
Copy link

i can confirm this

@ggazzo
Copy link
Member

ggazzo commented May 28, 2018

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

@IQ2022
Copy link

IQ2022 commented May 28, 2018

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

@IQ2022
Copy link

IQ2022 commented May 28, 2018

i have docker build and the above still an issue

@earlng
Copy link

earlng commented May 29, 2018

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

@muhv7
Copy link

muhv7 commented May 29, 2018

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

@vynmera
Copy link
Contributor

vynmera commented May 29, 2018

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...

@IQ2022
Copy link

IQ2022 commented May 29, 2018

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

@alvarow
Copy link

alvarow commented May 29, 2018

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

@muhv7
Copy link

muhv7 commented May 29, 2018

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

@teamsoo
Copy link
Author

teamsoo commented May 30, 2018

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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants