Skip to content

Commit

Permalink
Be extra careful to check the nspace when reconciling
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cowen committed Nov 26, 2019
1 parent 196a46d commit b1314a5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui-v2/app/services/repository/type/event-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ const createProxy = function(repo, find, settings, cache, serialize = JSON.strin
const meta = get(event.data || {}, 'meta') || {};
if (typeof meta.date !== 'undefined') {
// unload anything older than our current sync date/time
const checkNspace = meta.nspace !== '';
store.peekAll(repo.getModelName()).forEach(function(item) {
const dc = get(item, 'Datacenter');
const nspace = get(item, 'Namespace');
if (dc === meta.dc && nspace === meta.nspace) {
if (dc === meta.dc) {
if (checkNspace) {
const nspace = get(item, 'Namespace');
if (nspace !== meta.namespace) {
return;
}
}
const date = get(item, 'SyncTime');
if (typeof date !== 'undefined' && date != meta.date) {
store.unloadRecord(item);
Expand Down

0 comments on commit b1314a5

Please sign in to comment.