Recently we have migrated from SVF to SVF2 in our APS (Forge) viewer. However, sometimes we are receiving this error while trying to load a model on the viewer:
and this error in the console:
And when we go to Otg.js (through the console error) here is when the error has been thrown:
These are the options which we pass to Autodesk.Viewing.Initializer
to load SVF2 models:
var options = {
env: 'AutodeskProduction2',
api: 'streamingV2_EU',
getAccessToken,
};
And this is how we initialize the viewer:
Autodesk.Viewing.Initializer(options, () => {
const config = {
extensions: [
'Autodesk.DocumentBrowser',
'Autodesk.Viewing.MarkupsCore',
],
};
const container = document.getElementById('viewer');
if (container) {
// viewer-keeps-showing-old-model
Autodesk.Viewing.endpoint.HTTP_REQUEST_HEADERS[
'If-Modified-Since'
] = Date();
const viewer = new Autodesk.Viewing.GuiViewer3D(
container,
config
);
viewer.start();
}
});
And this is how we load the model:
Autodesk.Viewing.Document.load(
'urn:' + urn,
onDocumentLoadSuccess,
onDocumentLoadFailure
);
const onDocumentLoadSuccess = (doc) => {
if (doc.docRoot.data.status === 'success') {
const geometries = doc
.getRoot()
.search({ type: 'geometry' });
doc.downloadAecModelData();
viewer.loadDocumentNode(doc, geometries[index], {
createWireframe: false,
applyScaling: 'm',
isAEC: true,
})
}
};
And this is how we create buckets, upload and translate the models:
await new BucketsApi().createBucket(
{ bucketKey, policyKey: 'persistent' },
{ xAdsRegion: 'EMEA' }, // 'Europe, the Middle East and Africa'
oauth2Client,
credentials
);
await new ObjectsApi().uploadResources(
bucketKey,
[{ objectKey, data }],
{ useAcceleration: false, minutesExpiration: 15 },
oauth2Client,
credentials
);
const job = {
input: { urn },
output: { formats: [{ type: 'svf2', views: ['2d', '3d'] }] },
};
await new DerivativesApi(undefined, 'EU').translate(
job,
{ xAdsForce: true },
oauth2Client,
credentials
);
When we use api: 'derivativeV2_EU'
everything seems fine, but with api: 'streamingV2_EU'
sometimes we have this issue (especially our users in France).
We tested this with different browser and the result is the same.
Is there something we’ve missed causing this?