mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-15 09:34:13 +00:00
Creating snapshot triggers infinite loop for checking status update
This commit is contained in:
parent
5897a8fa4d
commit
37a99fbddd
8 changed files with 24 additions and 7 deletions
changelog/entries/unreleased/bug
enterprise/web-frontend/modules/baserow_enterprise/locales
web-frontend/modules
core
components
mixins
store
database/locales
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"type": "bug",
|
||||
"message": "Fix for creating snapshot triggers infinite loop for checking status update",
|
||||
"domain": "database",
|
||||
"issue_number": 3490,
|
||||
"bullet_points": [],
|
||||
"created_at": "2025-03-06"
|
||||
}
|
|
@ -470,4 +470,5 @@
|
|||
"periodicDataSyncDeactivatedNotification": {
|
||||
"body": "{name} periodic data sync has been deactivated because it failed too many times consecutively."
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@ export default {
|
|||
const { data: job } = await ExportWorkspaceService(
|
||||
this.$client
|
||||
).exportApplications(this.workspace.id, values)
|
||||
this.job = job
|
||||
await this.createAndMonitorJob(job)
|
||||
} catch (error) {
|
||||
this.createLoading = false
|
||||
|
|
|
@ -284,7 +284,6 @@ export default {
|
|||
const { data: job } = await ImportWorkspaceService(
|
||||
this.$client
|
||||
).triggerImport(this.workspace.id, this.resourceId)
|
||||
this.job = job
|
||||
await this.createAndMonitorJob(job)
|
||||
} catch (error) {
|
||||
this.importing = false
|
||||
|
|
|
@ -151,7 +151,6 @@ export default {
|
|||
this.application.id,
|
||||
values
|
||||
)
|
||||
this.job = job
|
||||
await this.createAndMonitorJob(job)
|
||||
} catch (error) {
|
||||
this.createLoading = false
|
||||
|
@ -167,6 +166,7 @@ export default {
|
|||
) {
|
||||
this.snapshots.unshift(this.job.snapshot)
|
||||
}
|
||||
this.$refs.form.v$.$reset()
|
||||
},
|
||||
onJobFailed() {
|
||||
this.createLoading = false
|
||||
|
|
|
@ -91,8 +91,7 @@ export default {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
async createAndMonitorJob(job) {
|
||||
await this.$store.dispatch('job/create', job)
|
||||
this.job = job
|
||||
this.job = await this.$store.dispatch('job/create', job)
|
||||
},
|
||||
/**
|
||||
* Called from a component to cancel any job currently running.
|
||||
|
|
|
@ -31,8 +31,17 @@ export const mutations = {
|
|||
SET_ITEMS(state, items) {
|
||||
state.items = items
|
||||
},
|
||||
/**
|
||||
* Adds new job to the store.
|
||||
* Adding job might be triggered from various places i.e. backend POST response
|
||||
* or from websocket message. In those cases we want to make sure we don't add
|
||||
* the same job multiple times.
|
||||
*/
|
||||
ADD_ITEM(state, item) {
|
||||
state.items.push(item)
|
||||
const existingJobIndex = state.items.findIndex((job) => job.id === item.id)
|
||||
if (existingJobIndex === -1) {
|
||||
state.items.push(item)
|
||||
}
|
||||
},
|
||||
UPDATE_ITEM(state, { id, values }) {
|
||||
const index = state.items.findIndex((item) => item.id === id)
|
||||
|
@ -180,6 +189,7 @@ export const actions = {
|
|||
create({ dispatch }, job) {
|
||||
dispatch('forceCreate', job)
|
||||
dispatch('tryScheduleNextUpdate')
|
||||
return this.getters['job/get'](job.id)
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -830,7 +830,8 @@
|
|||
"snapshot": "Snapshot",
|
||||
"importingState": "Creating",
|
||||
"reset": "Create another",
|
||||
"noSnapshots": "No snapshots for this application yet."
|
||||
"noSnapshots": "No snapshots for this application yet.",
|
||||
"nameAlreadyExists": "A snapshot with this name already exists."
|
||||
},
|
||||
"deleteSnapshotModal": {
|
||||
"title": "Delete snapshot",
|
||||
|
|
Loading…
Add table
Reference in a new issue