0

I am making a communication app in Rails, but I have encountered a strange bug.
Image dosen't display at the first visit on specific page.

bug photo & no bug photo

Detail

The Bug occurs only at the first visit on this page.
After the bug occurs, if do the following things, image will be displayed normally.

  1. Visit the page again via another page
  2. Update the page
  3. Tap "select an element in the page to inspect it" on chrome console.(very strange)

Solution

If set "data-turbolinks = 'false'" to "a tag" before visit the page, images will be displayed without the bug, but I want to keep turbolinks.
Is there anyone has a solution?

ray
  • 5,454
  • 1
  • 18
  • 40
Broly
  • 25
  • 1
  • 4
  • Both of your links (bug and no bug) showing photo for me without any problem. Try to reset your browser and application cache, try to reproduce bug in other browsers and in incognito mode in Chrome. – Alex Baidan Feb 05 '19 at 08:17
  • Do you use some js code for image displaying? If yes, add it to the question, please – Vasilisa Feb 05 '19 at 09:15
  • @Oleksii Baidan I reset browser and cashe, and check incognito mode, but the bug was still remain. I have resolved by my self. Thank you! – Broly Feb 05 '19 at 10:11
  • @Vasilisa I didn't use js code to display the image that bug occurred. I proceeded the verification and have resolved by my self. Thank you! – Broly Feb 05 '19 at 10:15

1 Answers1

0

I didn't fix the cause of the bug, so it can not be said to be a solution, but I have relolved it with another way.

I surveyed mainly on javascript and the result was as follows.

  • Bug disappear if turn off javascript on browser.
  • Even if all javascript files other than applocation.js are deleted, the bug remains.

After all I felt like the cause was turbolinks, but I didn't want to turn off turbolonks, so I continued the investigation.
I proceeded the verification based on a strange event that fix the bug when tap "select an element in the page to inspect it" of chrome console.

And I found the bug was fixed that it was not only to tap that part, but also when switching(show / hide) the console itself.(Verified with chrome and safari)

I resized the window as a test when the bug occurred, the bug was fixed.
I added a js code that resize width a bit when visit the page. The bug isn't occurred so far.

Broly
  • 25
  • 1
  • 4