adobe / acc-js-sdk

A JavaScript SDK for Adobe Campaign Classic
Apache License 2.0
21 stars 22 forks source link

NEO-62095: ensure to reload xtk:session #86

Closed obriard closed 1 year ago

obriard commented 1 year ago

Description

Ensure that methods of the schema xtk:session and xtk:persist are loaded when doing a getSchema

Related Issue

When loadiing xtk:session it is possible that the schema is already in the browser cache, because browser storage is persistent). Therefore the schema was loaded from cache of the browser to the memory and the methods of the schema were not loaded in memory.

In same case the cache does not content anymore the methods of xtk:persist because cache values have expired. But entitycache still contents the schema xtk;persist So when calling a implemented method in xtk:persist (like Duplicate) from a schema (like xtk;workflow) not loaded yet, it fails:

{
    "name": "CampaignException",
    "message": "400 - Error 16384: SDK-000009 Unknown method 'Duplicate' of schema 'xtk:workflow'. Method 'Duplicate' of schema 'xtk:workflow' not found",
    "statusCode": 400,
    "errorCode": "SDK-000009",
    "faultCode": 16384,
    "faultString": "Unknown method 'Duplicate' of schema 'xtk:workflow'",
    "detail": "Method 'Duplicate' of schema 'xtk:workflow' not found"
}

Motivation and Context

Bug fix

How Has This Been Tested?

added unit tests tested in web ui context

Screenshots (if appropriate):

Types of changes

Checklist: