I’m inserting a new file, and using the returned File object to store a thumbnail. Intermittently, getThumbnail() returns null for .pdf files.
I’m guessing that the explanation is the thumbnail is generated asynchronously and there are times when the processing is incomplete before the insert() call returns with anincomplete File object.
Is there any way I can make this behave more deterministically?
Alternatively, anybody know if the subsequent processing of the thumbnail constitutes a “change” that would be returned by a get changes call?
AFAIK yes the thumbnails are calculated asynchronously. The delay can be different based on server loads, file type and file size but in my testing the thumbs for PDF were available very shortly after the file has been created.
Probably at this point the best you could do is try a subsequent request and keep trying until you get a thumbnail but don’t forget to use exponential back-off not to overload the server and kill your quota in some case.
I don’t think that when the thumbnail is ready this counts as a change in the changes feed in that case.