Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: fix issue with changing files with the same last modified data time

Ilian Sapundshievc85d0d2aac3e
diff --git a/package-lock.json b/package-lock.json
index 5b13a3070..b733decf8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -133,7 +133,6 @@
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.28.1",
- "eslint-plugin-jest": "^27.4.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
@@ -168,7 +167,6 @@
"style-loader": "^3.3.3",
"stylelint": "^15.11.0",
"terser-webpack-plugin": "^5.3.9",
- "ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
@@ -22674,19 +22672,6 @@
"electron": ">=12.0.0"
}
},
- "node_modules/bs-logger": {
- "version": "0.2.6",
- "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
- "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fast-json-stable-stringify": "2.x"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/bser": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
@@ -45529,82 +45514,6 @@
"typescript": ">=4.2.0"
}
},
- "node_modules/ts-jest": {
- "version": "29.4.0",
- "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.0.tgz",
- "integrity": "sha512-d423TJMnJGu80/eSgfQ5w/R+0zFJvdtTxwtF9KzFFunOpSeD+79lHJQIiAhluJoyGRbvj9NZJsl9WjCUo0ND7Q==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "bs-logger": "^0.2.6",
- "ejs": "^3.1.10",
- "fast-json-stable-stringify": "^2.1.0",
- "json5": "^2.2.3",
- "lodash.memoize": "^4.1.2",
- "make-error": "^1.3.6",
- "semver": "^7.7.2",
- "type-fest": "^4.41.0",
- "yargs-parser": "^21.1.1"
- },
- "bin": {
- "ts-jest": "cli.js"
- },
- "engines": {
- "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0"
- },
- "peerDependencies": {
- "@babel/core": ">=7.0.0-beta.0 <8",
- "@jest/transform": "^29.0.0 || ^30.0.0",
- "@jest/types": "^29.0.0 || ^30.0.0",
- "babel-jest": "^29.0.0 || ^30.0.0",
- "jest": "^29.0.0 || ^30.0.0",
- "jest-util": "^29.0.0 || ^30.0.0",
- "typescript": ">=4.3 <6"
- },
- "peerDependenciesMeta": {
- "@babel/core": {
- "optional": true
- },
- "@jest/transform": {
- "optional": true
- },
- "@jest/types": {
- "optional": true
- },
- "babel-jest": {
- "optional": true
- },
- "esbuild": {
- "optional": true
- },
- "jest-util": {
- "optional": true
- }
- }
- },
- "node_modules/ts-jest/node_modules/type-fest": {
- "version": "4.41.0",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",
- "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
- "engines": {
- "node": ">=16"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ts-jest/node_modules/yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/ts-loader": {
"version": "9.5.2",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.2.tgz",
diff --git a/package.json b/package.json
index e1183cd2f..2bc464647 100644
--- a/package.json
+++ b/package.json
@@ -136,7 +136,6 @@
"start-main-debug": "npm run dev --inspect=5858 --remote-debugging-port=9223",
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
- "test": "jest",
"test-clone-data": "rimraf tests/testdata && git clone https://github.com/tagspaces/testdata tests/testdata",
"test-playwright": "npx playwright install --with-deps && cross-env npx playwright test --project=electron-light",
"test-playwright-pro": "npx playwright install --with-deps && cross-env npx playwright test --project=electron",
@@ -287,7 +286,6 @@
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.28.1",
- "eslint-plugin-jest": "^27.4.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
@@ -322,7 +320,6 @@
"style-loader": "^3.3.3",
"stylelint": "^15.11.0",
"terser-webpack-plugin": "^5.3.9",
- "ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
diff --git a/src/renderer/components/FileView.tsx b/src/renderer/components/FileView.tsx
index 504239459..df150065a 100644
--- a/src/renderer/components/FileView.tsx
+++ b/src/renderer/components/FileView.tsx
@@ -249,10 +249,7 @@ function FileView(props: Props) {
}
return 'about:blank';
}, [
- openedEntry?.lmdt,
- openedEntry?.isEncrypted,
- openedEntry?.viewingExtensionPath,
- openedEntry?.editingExtensionPath,
+ openedEntry?.path,
isEditMode,
theme.palette,
searchQuery?.textQuery,
diff --git a/tests/unit/search.disabledtest.js b/tests/unit/search.disabledtest.js
index 992850be8..8da965a33 100644
--- a/tests/unit/search.disabledtest.js
+++ b/tests/unit/search.disabledtest.js
@@ -1,29 +1,8 @@
-import { test, expect } from '@playwright/test';
+import { expect, test } from '@playwright/test';
import Search from '../../app/services/search';
-// import { FileTypeGroups } from '../../app/services/search';
const testEntries = require('./tsi.json');
-// const mockedSearchIndex = { data: {} };
-// const SearchMock = jest.fn();
-// SearchMock.mockReturnValue(Promise.resolve(mockedSearchIndex));
-// Search.searchLocationIndex = SearchMock;
-
-// jest.mock('../../app/services/search');
-
-// test('calls Search.searchLocationIndex with the params', () => {
-// const locationContent = [];
-// const searchQuery = {
-// tagsAND: ['tag'],
-// maxSearchResults: 1
-// };
-
-// expect(
-// Search.searchLocationIndex(locationContent, searchQuery)
-// ).resolves.toStrictEqual(mockedSearchIndex);
-// expect(SearchMock).toHaveBeenCalledWith(locationContent, searchQuery);
-// });
-
const tag1 = { title: 'tagTitle1' };
const tag2 = { title: 'tagTitle2' };
const tag3 = { title: 'tagTitle3' };
@@ -133,25 +112,6 @@ test('calls Search.searchLocationIndex for textQuery', async () => {
expect(searchResults[0].name).toStrictEqual('IMG_20191001_163655.jpg');
});
-//jest.mock('../../app/pro', () => require('../../extensions/pro'));
-//jest.mock('../../extensions/pro/modules/thumbsgenerator');
-//jest.mock('../../app/services/platform-io');
-
-/*
-test('calls Search.searchLocationIndex for Pro', () => {
-
- const locationContent = [entry1, entry2];
-
- const searchQuery = {
- textQuery: 'description'
- };
-
- expect(
- Search.searchLocationIndex(locationContent, searchQuery)
- ).resolves.toStrictEqual([entry1]);
-});
-*/
-
test.skip('calls Search.searchLocationIndex for extension', async () => {
const searchQuery = {
FileTypeGroups: images,