shopifySync | transitionState required?

For an older app of mine, is it safe to just update shopifySync methods to how they look in newer app templates? E.g. remove the transitionState() part? E.g. the run function (js) from:
/**
* @param { RunShopifySyncActionContext } context
*/
export async function run({ params, record, logger, api }) {
transitionState(record, {to: ShopifySyncState.Running});
applyParams(params, record);
await preventCrossShopDataAccess(params, record);
await save(record);
await shopifySync(params, record);
};
/**
* @param { RunShopifySyncActionContext } context
*/
export async function run({ params, record, logger, api }) {
transitionState(record, {to: ShopifySyncState.Running});
applyParams(params, record);
await preventCrossShopDataAccess(params, record);
await save(record);
await shopifySync(params, record);
};
to (ts):
export const run: ActionRun = async ({ params, record, logger, api, connections }) => {
applyParams(params, record);
await preventCrossShopDataAccess(params, record);
await save(record);
await shopifySync(params, record);
};
export const run: ActionRun = async ({ params, record, logger, api, connections }) => {
applyParams(params, record);
await preventCrossShopDataAccess(params, record);
await save(record);
await shopifySync(params, record);
};
2 Replies
Smelvin
Smelvin3w ago
Hi Simon, which framework is the app on? In the recent frameworks gadget handles the state transitions automatically, so it should be safe to remove.
Simon
SimonOP3w ago
Hi Mark, it's on 1.4, thank you! I'll go ahead and remove those.

Did you find this page helpful?