0

The Forge API https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-PUT/ has a clear method for overwriting an existing object with the same filename - the If-Match header.

I'm using the Using the C# API found at https://github.com/Autodesk-Forge/forge-api-dotnet-client and I'm calling UploadObjectWithHttpInfo to upload a new revision of a file (and setting the ifMatch parameter with the correct SHA1 hash that I saved from the previous upload). The 'new revision' is nothing more than the exact same file with a very noticable door on the south side of the building deleted. Checking the files visually in Revit 2017 shows that they are different. I'm using the same filename as the previous version of the file.

If I don't supply the correct SHA-1, the API correctly responds with HTTP 412. If I do supply the SHA-1 correctly, the API responds with the expected results, including a new SHA-1 (which I save). The document URN does not seem to change.

I immediately call another Translate job on this file (which succeeds very quickly), wait a few minutes, and navigate to the viewer page which loads the document URN.

The viewer shows the first revision of the file, with the door still present.

What am I missing?

Broam
  • 4,602
  • 1
  • 23
  • 38
  • 1
    Just a few quick checkpoints to be on the safe side: - Did you load the new URN from the other translate job w/o the door? Was it different from the old one? - Can you [check the manifest](https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET/) and verify if the door is present, just to isolate the issue from cached, stale content? – Bryan Huang Nov 01 '18 at 03:20
  • The URN, iirc, is directly based off of the FileName, which is deliberately not changing. My application needs a "replace this file" function which takes the new file and supplies it as an update to the endpoint with the original filename. Will answer about manifest shortly – Broam Nov 01 '18 at 14:28
  • Manifest shows that both jobs (translate to SVF, and Thumbnail) are complete. – Broam Nov 01 '18 at 14:40

1 Answers1

1

If the URN wasn't changed after translating the revisions, please add the following header to force the service to regenerate all viewables:

x-ads-force: true

Checked and found this was working for the others. See here, here, here and here.

Another thing you might wanna try is to delete the manifest before you fire the job. And also don't let browser cache be the pitfall here.

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20
  • How would I go about doing this using the Forge C# API client libraries? (Never mind, newer versions have an optional argument) – Broam Nov 08 '18 at 14:40
  • Ok, this doesn't seem to work, or I'm doing something *completely* wrong. Thanks for the suggestion. – Broam Nov 08 '18 at 19:27
  • Uploading the revision of the file as a different filename shows the changes. This is definitely not working even with the force-regenerate. – Broam Nov 08 '18 at 19:43
  • It's not the *browser cache* that's the problem, it however could be the *viewer* cache. I will investigate. – Broam Nov 14 '18 at 16:08