Skip to content

Commit

Permalink
perf(appbuilder): reduce number of ListRemoteTestEvent calls by remot…
Browse files Browse the repository at this point in the history
…e invoke #6559

Problem:
Remote Invoke call ListRemoteTestEvent every time the webview is instantiated. 

Solution:
Introduce a condition for which this api calls can be
made thereby reducing the spike in number failures we see in our
dashboard.
  • Loading branch information
jonife authored Feb 12, 2025
1 parent 8126a56 commit 7d5a339
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
value="savedEvents"
v-model="payload"
name="payload_request"
@change="$emit('loadRemoteTestEvents')"
/>
<label class="label-selector" for="savedEvents"> Remote saved events</label>
</div>
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ export default defineComponent({
}
)
},

async loadRemoteTestEvents() {
const shouldLoadEvents =
this.payload === 'savedEvents' &&
this.initialData.FunctionArn &&
this.initialData.FunctionRegion &&
!this.initialData.TestEvents

if (shouldLoadEvents) {
this.initialData.TestEvents = await client.listRemoteTestEvents(
this.initialData.FunctionArn,
this.initialData.FunctionRegion
)
}
},
},
mixins: [saveData],
})

0 comments on commit 7d5a339

Please sign in to comment.