Object Store: any way to remove/extend ttlSeconds on an object that's already been uploaded?

We set ttlSeconds on objects created via createUploadUrl / uploadBuffersToObjectStore, and now need to change the TTL policy for objects that already exist in the store (e.g. remove the expiry on files that were uploaded with one). Per the docs (https://developer.atlassian.com/platform/forge/storage-reference/object-store-api/), ttlSeconds only appears to be settable at creation time, and per this thread omitting it on new uploads stores them indefinitely: Forge Object store default ttl

What we haven’t found is any way to change the TTL of an object that’s already stored — fos.get() only returns metadata, fos.delete() only removes it, and there doesn’t seem to be a copy/update operation.

  • Is there any supported way — API, internal mechanism, or otherwise — to change the TTL of an object that’s already stored, without re-uploading it?
  • If not, is a download-and-re-upload under a new key the recommended way to move an object off an expiring TTL, or is there a better pattern?

Any pointers appreciated.

Hi @DanielChodkowski,

No update op exists. Going by the published typings the package only has get, delete, createUploadUrl, createPublicUploadUrl, createDownloadUrl, createPublicDownloadUrl and createCDNUrl, and the ObjectReference that get returns carries no ttl field at all.

It’s still a full re-upload, you pull the bytes with createDownloadUrl and PUT them again. A new key isn’t needed though. Call createUploadUrl again for the same key, overwrite is true by default and replaces the stored object: https://developer.atlassian.com/platform/forge/storage-reference/object-store-api/ Pass the new ttlSeconds, or leave it out for no expiry as staff said in Forge Object store default ttl

Not tested live. The clock resetting on overwrite is my reading of the docs, so overwrite one object with a short ttl first and check it expires on the new schedule.