Skip to content

Thumbnail API asks for a preview twice each time #16551

Closed

Description

@oparoz

ENV

Master only, PHP 5.5, Redis cache

Steps to reproduce

  1. Add this at the top of your getPreview method
    \OCP\Util::writeLog('core', 'CALLING GETPREVIEW ', \OCP\Util::DEBUG);
  2. Go to http://localhost/index.php/apps/files/api/v1/thumbnail/300/300/test.jpg
  3. Check the logs

Expected result

The logs should show one "CALLING GETPREVIEW" message

Actual result

The logs show 2 "CALLING GETPREVIEW" message

The controller is here, but I don't see anything suspicious
https://github.com/owncloud/core/blob/master/apps/files/controller/apicontroller.php#L76

I thought it could be my code, but using the URL used by the Files app or the Gallery app don't exhibit the same problem.

Activity

  1. changed the title [-]Thumbnail API asks for previews twice each time[/-] [+]Thumbnail API asks for a preview twice each time[/+] on May 24, 2015
  2. oparoz commented on May 24, 2015

    @oparoz
    ContributorAuthor

    @rullzer - Can you confirm this?

  3. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    CC @georgehrke

    This can probably be bisected to find out when it got broken

  4. georgehrke commented on May 26, 2015

    @georgehrke
    Contributor

    I'm on PHP 5.5 as well and it's only called once for me.

    • only one log entry
    • XDebug hits the breakpoint only one time as well

    I don't have a redis cache set up, but that shouldn't cause such errors (hopefully)

  5. georgehrke commented on May 26, 2015

    @georgehrke
    Contributor

    @PVince81 Can you reproduce this behavior?

  6. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    What am I doing wrong ?

    I have a file called "test.jpg" in the root.
    But this:

    curl http://root:admin@localhost/index.php/apps/files/api/v1/thumbnail/300/300/test.jpg
    

    gives me a 404

  7. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    damn copy-paste, I forgot the context path...

  8. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    I only get the log message once when downloading the preview with curl.

  9. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    aka WORKFORME 😉

  10. rullzer commented on May 26, 2015

    @rullzer
    Contributor

    Same here.. only 1 log message...

  11. PVince81 commented on May 26, 2015

    @PVince81
    Contributor

    @oparoz please double check your steps

  12. oparoz commented on May 26, 2015

    @oparoz
    ContributorAuthor

    Hmmm... I've just tried again and same problem, but my branch is a bit behind. I'll try again after a pull.

      'version' => '8.1.0.6',
      'logtimezone' => 'UTC',
      'installed' => true,
      'forcessl' => true,
      'loglevel' => '0',
      'memcache.local' => '\\OC\\Memcache\\Redis',
      'preview_max_x' => 756,
      'preview_max_y' => 756,
      'preview_max_scale_factor' => 2,
      'theme' => '',
      'maintenance' => false,
      'skeletondirectory' => '',
      'enabledPreviewProviders' =>
      array (
        0 => 'OC\\Preview\\JPEG',
        1 => 'OC\\Preview\\PNG',
        2 => 'OC\\Preview\\TXT',
        3 => 'OC\\Preview\\Postscript',
      ),
    
  13. oparoz commented on May 29, 2015

    @oparoz
    ContributorAuthor

    Thanks for testing guys. It turns out it's a browser issue. I have no idea why, but after a while, Firefox tries to make the same request 2 or even 3 times... Might have something to do with having several tabs open for the same cloud.

  14. locked as resolved and limited conversation to collaborators on Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions