mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix saving index pattern when there is a conflict (#21947)
This commit is contained in:
parent
e49d5f3b10
commit
341d5008dc
2 changed files with 5 additions and 3 deletions
|
@ -99,7 +99,9 @@ jest.mock('../../saved_objects', () => {
|
|||
update: async (type, id, body, { version }) => {
|
||||
if (object._version !== version) {
|
||||
throw {
|
||||
statusCode: 409
|
||||
res: {
|
||||
status: 409
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -158,6 +160,6 @@ describe('IndexPattern', () => {
|
|||
result = err;
|
||||
}
|
||||
|
||||
expect(result.statusCode).toBe(409);
|
||||
expect(result.res.status).toBe(409);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -463,7 +463,7 @@ export function IndexPatternProvider(Private, config, Promise, confirmModalPromi
|
|||
setVersion(this, _version);
|
||||
})
|
||||
.catch(err => {
|
||||
if (err.statusCode === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) {
|
||||
if (_.get(err, 'res.status') === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) {
|
||||
const samePattern = new IndexPattern(this.id);
|
||||
return samePattern.init()
|
||||
.then(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue