[webkit-changes] [WebKit/WebKit] 4b61f0: DATA LOSS: currentDatabaseSchemaVersion is incorre...

Timothy Hatcher noreply at github.com
Tue Sep 17 15:21:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4b61f0414c2c1b826c99bf95c74190a19ab4e926
      https://github.com/WebKit/WebKit/commit/4b61f0414c2c1b826c99bf95c74190a19ab4e926
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-09-17 (Tue, 17 Sep 2024)

  Changed paths:
    M Source/WebKit/Shared/Extensions/_WKWebExtensionSQLiteStore.h
    M Source/WebKit/Shared/Extensions/_WKWebExtensionSQLiteStore.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionStorageSQLiteStore.mm

  Log Message:
  -----------
  DATA LOSS: currentDatabaseSchemaVersion is incorrect for Web Extension storage.
https://webkit.org/b/279831
rdar://problem/136159837

Reviewed by Brian Weinstein.

Safari shipped with a database schema version of 2, but when migrating to WebKit, the version was
incorrectly marked as 1. This mismatch was triggering a database schema reset, erasing all storage
data. However, since the schema for version 2 (Safari) and version 1 (WebKit) are identical, we simply
set the version and return the current version to avoid unnecessary data loss.

* Source/WebKit/Shared/Extensions/_WKWebExtensionSQLiteStore.h:
* Source/WebKit/Shared/Extensions/_WKWebExtensionSQLiteStore.mm:
(currentDatabaseSchemaVersion): Set to 2, matching Safari.
(-[_WKWebExtensionSQLiteStore _migrateToCurrentSchemaVersionIfNeeded]): Use _databaseSchemaVersion.
(-[_WKWebExtensionSQLiteStore _databaseSchemaVersion]): Added.
(-[_WKWebExtensionSQLiteStore _setDatabaseSchemaVersion:]): Removed "return 0;" dead code.
* Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionStorageSQLiteStore.mm:
(-[_WKWebExtensionStorageSQLiteStore _migrateToCurrentSchemaVersionIfNeeded]): Added.

Canonical link: https://commits.webkit.org/283802@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list