Skip to content

Commit 7d5a339

Browse files
authored
perf(appbuilder): reduce number of ListRemoteTestEvent calls by remote 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.
1 parent 8126a56 commit 7d5a339

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
value="savedEvents"
6868
v-model="payload"
6969
name="payload_request"
70+
@change="$emit('loadRemoteTestEvents')"
7071
/>
7172
<label class="label-selector" for="savedEvents"> Remote saved events</label>
7273
</div>

packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,21 @@ export default defineComponent({
132132
}
133133
)
134134
},
135+
136+
async loadRemoteTestEvents() {
137+
const shouldLoadEvents =
138+
this.payload === 'savedEvents' &&
139+
this.initialData.FunctionArn &&
140+
this.initialData.FunctionRegion &&
141+
!this.initialData.TestEvents
142+
143+
if (shouldLoadEvents) {
144+
this.initialData.TestEvents = await client.listRemoteTestEvents(
145+
this.initialData.FunctionArn,
146+
this.initialData.FunctionRegion
147+
)
148+
}
149+
},
135150
},
136151
mixins: [saveData],
137152
})

0 commit comments

Comments
 (0)