diff --git a/src/classes/collection/collection.ts b/src/classes/collection/collection.ts index 6fcd1cab1..c69fb21ab 100644 --- a/src/classes/collection/collection.ts +++ b/src/classes/collection/collection.ts @@ -8,7 +8,6 @@ import { rejection } from "../../helpers/promise"; import { combine } from "../../functions/combine"; import { extend, hasOwn, deepClone, keys, setByKeyPath, getByKeyPath } from "../../functions/utils"; import { ModifyError } from "../../errors"; -import { hangsOnDeleteLargeKeyRange } from "../../globals/constants"; import { ThenShortcut } from "../../public/types/then-shortcut"; import { Transaction } from '../transaction'; import { DBCoreCursor, DBCoreTransaction, DBCoreRangeType, DBCoreMutateResponse, DBCoreKeyRange } from '../../public/types/dbcore'; @@ -594,7 +593,7 @@ export class Collection implements ICollection { //deletingHook = ctx.table.hook.deleting.fire, //hasDeleteHook = deletingHook !== nop; if (isPlainKeyRange(ctx) && - ((ctx.isPrimKey && !hangsOnDeleteLargeKeyRange) || range.type === DBCoreRangeType.Any)) // if no range, we'll use clear(). + (ctx.isPrimKey || range.type === DBCoreRangeType.Any)) // if no range, we'll use clear(). { // May use IDBObjectStore.delete(IDBKeyRange) in this case (Issue #208) // For chromium, this is the way most optimized version. diff --git a/src/classes/version/schema-helpers.ts b/src/classes/version/schema-helpers.ts index 6d683811f..366fd4a0a 100644 --- a/src/classes/version/schema-helpers.ts +++ b/src/classes/version/schema-helpers.ts @@ -8,7 +8,6 @@ import Promise, { PSD, newScope, NativePromise, decrementExpectedAwaits, increme import { exceptions } from '../../errors'; import { TableSchema } from '../../public/types/table-schema'; import { IndexSpec } from '../../public/types/index-spec'; -import { hasIEDeleteObjectStoreBug, isIEOrEdge } from '../../globals/constants'; import { createIndexSpec, nameFromKeyPath } from '../../helpers/index-spec'; import { createTableSchema } from '../../helpers/table-schema'; import { generateMiddlewareStacks } from '../dexie/generate-middleware-stacks'; @@ -231,11 +230,9 @@ function updateTablesAndIndexes( } }); queue.push(idbtrans => { - if (!anyContentUpgraderHasRun || !hasIEDeleteObjectStoreBug) { // Dont delete old tables if ieBug is present and a content upgrader has run. Let tables be left in DB so far. This needs to be taken care of. - const newSchema = version._cfg.dbschema; - // Delete old tables - deleteRemovedTables(newSchema, idbtrans); - } + const newSchema = version._cfg.dbschema; + // Delete old tables + deleteRemovedTables(newSchema, idbtrans); // Restore the final API removeTablesApi(db, [db.Transaction.prototype]); setApiOnPlace(db, [db.Transaction.prototype], db._storeNames, db._dbSchema); @@ -316,7 +313,7 @@ export function getSchemaDiff(oldSchema: DbSchema, newSchema: DbSchema): SchemaD ''+(newDef.primKey.keyPath||'') ) || // Compare the autoIncrement flag also - (oldDef.primKey.auto !== newDef.primKey.auto && !isIEOrEdge)) // IE has bug reading autoIncrement prop. + (oldDef.primKey.auto !== newDef.primKey.auto)) { // Primary key has changed. Remove and re-add table. change.recreate = true; diff --git a/src/globals/constants.ts b/src/globals/constants.ts index 98bd0b21d..6fed78466 100644 --- a/src/globals/constants.ts +++ b/src/globals/constants.ts @@ -7,10 +7,6 @@ export const INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array."; export const STRING_EXPECTED = "String expected."; export const connections: Dexie[] = []; -export const isIEOrEdge = - typeof navigator !== 'undefined' && /(MSIE|Trident|Edge)/.test(navigator.userAgent); -export const hasIEDeleteObjectStoreBug = isIEOrEdge; -export const hangsOnDeleteLargeKeyRange = isIEOrEdge; export const dexieStackFrameFilter = frame => !/(dexie\.js|dexie\.min\.js)/.test(frame); export const DBNAMES_DB = '__dbnames'; export const READONLY = 'readonly'; diff --git a/src/live-query/propagate-locally.ts b/src/live-query/propagate-locally.ts index c5b6c8f76..b79c9430d 100644 --- a/src/live-query/propagate-locally.ts +++ b/src/live-query/propagate-locally.ts @@ -1,4 +1,3 @@ -import { isIEOrEdge } from '../globals/constants'; import { globalEvents, DEXIE_STORAGE_MUTATED_EVENT_NAME, STORAGE_MUTATED_DOM_EVENT_NAME } from '../globals/global-events'; import { ObservabilitySet } from "../public/types/db-events"; import { signalSubscribersNow } from './cache/signalSubscribers'; @@ -7,14 +6,9 @@ if (typeof dispatchEvent !== 'undefined' && typeof addEventListener !== 'undefin globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, updatedParts => { if (!propagatingLocally) { let event: CustomEvent; - if (isIEOrEdge) { - event = document.createEvent('CustomEvent'); - event.initCustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME, true, true, updatedParts); - } else { - event = new CustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME, { - detail: updatedParts - }); - } + event = new CustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME, { + detail: updatedParts + }); propagatingLocally = true; dispatchEvent(event); propagatingLocally = false;