From 320b07f19a5b8531335bcc23ae180b384ae3f718 Mon Sep 17 00:00:00 2001 From: Jagoda Berry Rybacka Date: Thu, 20 Jul 2023 16:41:27 +0200 Subject: [PATCH 1/2] v0.43.0 --- .github/ISSUE_TEMPLATE/BUG.yml | 1 + manifest/manifest.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/BUG.yml b/.github/ISSUE_TEMPLATE/BUG.yml index 2a3e37dbab..309cc3954f 100644 --- a/.github/ISSUE_TEMPLATE/BUG.yml +++ b/.github/ISSUE_TEMPLATE/BUG.yml @@ -51,6 +51,7 @@ body: label: Version description: What version of the extension are you running? options: + - v0.43.0 - v0.42.0 - v0.41.0 - v0.40.2 diff --git a/manifest/manifest.json b/manifest/manifest.json index 9d455e8fe7..c1e78c2827 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,6 +1,6 @@ { "name": "Taho", - "version": "0.42.0", + "version": "0.43.0", "description": "The community owned and operated Web3 wallet.", "homepage_url": "https://taho.xyz", "author": "https://taho.xyz", diff --git a/package.json b/package.json index 45cb48c32d..d1358caede 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@tallyho/tally-extension", "private": true, - "version": "0.42.0", + "version": "0.43.0", "description": "Taho, the community owned and operated Web3 wallet.", "main": "index.js", "repository": "git@github.com:thesis/tally-extension.git", From fd8c798a24b486e454c15087bf886c24996c30c2 Mon Sep 17 00:00:00 2001 From: hyphenized <28708889+hyphenized@users.noreply.github.com> Date: Thu, 20 Jul 2023 11:49:55 -0500 Subject: [PATCH 2/2] Add bigint filter for jsondiffpatch In the current implementation, bigints are treated as objects and are incorrectly excluded from patches. This fixes bigint diffing by adding a handler for these cases to the jsondiffpatch pipeline. --- background/differ.ts | 18 ++++++++++++++++++ background/index.ts | 2 +- background/main.ts | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 background/differ.ts diff --git a/background/differ.ts b/background/differ.ts new file mode 100644 index 0000000000..c43b1e8cf1 --- /dev/null +++ b/background/differ.ts @@ -0,0 +1,18 @@ +import { DiffContext, Filter, create } from "jsondiffpatch" + +const differ = create() + +const bigintDiffFilter: Filter = (context) => { + if (typeof context.left === "bigint" && typeof context.right === "bigint") { + if (context.left !== context.right) { + context.setResult([context.left, context.right]) + } + } +} +bigintDiffFilter.filterName = "bigint" + +differ.processor.pipes.diff.before("objects", bigintDiffFilter) + +export const diff = differ.diff.bind(differ) +export const patch = differ.patch.bind(differ) +export type { Delta } from "jsondiffpatch" diff --git a/background/index.ts b/background/index.ts index b80f9d4a90..3ef5b4f657 100644 --- a/background/index.ts +++ b/background/index.ts @@ -1,10 +1,10 @@ import browser from "webextension-polyfill" import { Store as ProxyStore } from "webext-redux" -import { Delta, patch as patchDeepDiff } from "jsondiffpatch" import { produce } from "immer" import { AnyAction } from "@reduxjs/toolkit" +import { Delta, patch as patchDeepDiff } from "./differ" import Main from "./main" import { encodeJSON, decodeJSON } from "./lib/utils" diff --git a/background/main.ts b/background/main.ts index 01eae2e1d9..fc60e83b1c 100644 --- a/background/main.ts +++ b/background/main.ts @@ -1,12 +1,12 @@ import browser, { runtime } from "webextension-polyfill" import { alias, wrapStore } from "webext-redux" -import { diff as deepDiff } from "jsondiffpatch" import { configureStore, isPlain, Middleware } from "@reduxjs/toolkit" import { devToolsEnhancer } from "@redux-devtools/remote" import { PermissionRequest } from "@tallyho/provider-bridge-shared" import { debounce } from "lodash" import { utils } from "ethers" +import { diff as deepDiff } from "./differ" import { decodeJSON, encodeJSON,