Skip to content

Commit 1eb2e6c

Browse files
authored
Merge pull request #1740 from qdraw/feature/202410_code_smells_2
make more readonly
2 parents 89a26b1 + a5f055b commit 1eb2e6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4206
-5842
lines changed

documentation/blog/20221231-project-starsky-2022-a-year-in-review.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ image: https://media.qdraw.nl/log/de-7-dingen-die-ik-miste-bij-het-beheren-van-m
1111

1212
So it was high time to optimise the time-consuming process of photo management. I really enjoy going out and taking pictures. But when I get home, it’s time to properly organise all those photos. That task is typically something we postpone, but it is nice to share the photos and experiences. I have developed a piece of software for this process and in this blog I will tell you what I have improved in this in 2022. This year it really started for the project. The first blog post about the project is a fact. In addition, a demo can also be viewed at [demo.qdraw.nl](https://demo.qdraw.nl)
1313

14+
/* truncate */
15+
1416
## 12 releases done in 2022
1517

1618
What have I worked on in the past year? For example, I’ve been working on real-time updates from the file system so you’re always up-to-date! Added a new type of sort in the list, write a temporary file first before writing a file, to avoid corrupted files. Upgraded to Microsoft’s .NET 6 framework. Added configuration to exclude directories from keeping index up to date. We now keep notifications in a uniform way, even if you have lost the connection for a while, you can retrieve the recent updates. Upgraded the front-end library: React 17 to 18 and the desktop app library: Electron upgraded to the latest version several times. The dependency on Exiftool to write the metadata has been reduced as it is already added during the build. Server side version added for M1/M2 Macs, the desktop version will follow at a later time, I’m running into Gatekeeper (security of Mac OS) issues there. The Diskwatcher functionality has been completely rewritten so that it takes a maximum of 20 seconds to check for duplicate events and filter them out, resulting in a huge performance gain. Furthermore, comparing the database and the file system has changed so that it is a lot faster than before. All this ensured that this works well and released version 0.5.0. Then worked on better documentation, there is still a lot to be gained here and adding locations manually. On to a good 2023!

documentation/blog/20231229-reflecting-on-a-year-of-progress-a-look-back-at-2023.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and a relentless commitment to enhancing the user experience.
1515
In this blog post, we'll delve into the notable updates and advancements
1616
encapsulated in the various releases of version 0.5.x of our software.
1717

18+
/* truncate */
19+
1820
## Version 0.5.13 - Front-end Accessibility and Code Refinement
1921

2022
The December release, version 0.5.13, showcased a concentrated effort on enhancing front-end accessibility.

documentation/blog/20240315-new-release-version-060.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ image: https://media.qdraw.nl/log/de-7-dingen-die-ik-miste-bij-het-beheren-van-m
1212
We're excited to unveil our latest release, Version 0.6.0, packed with exciting updates and
1313
enhancements to elevate your user experience! Let's dive into the key highlights of this release:
1414

15+
/* truncate */
16+
1517
## Backend Enhancements:
1618

1719
- **Upgrade to .NET 8**: Our backend system has been upgraded to .NET 8 - SDK 8.0.202 and Runtime

documentation/package-lock.json

+1,502-274
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

history.md

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Semantic Versioning 2.0.0 is from version 0.1.6+
4848
- [x] (Fixed) _Back-end_ Query execution was interrupted, Regex Timeout (Issue #1628, #1590) (PR #1676)
4949
- [x] (Fixed) _Back-end_ Download Exiftool did not work (PR #1677)
5050
- [x] (Changed) _Back-end_ Change password hashing security and auto-upgrade path (PR #1688)
51+
- [x] (Changed) _Back-end_ Fixed models for replace (PR #1740)
52+
- [x] (Changed) _Tools_ Update cypress and eslint to 9 (PR #1740)
53+
- [x] (Changed) _Front-end_ Make more properties readonly for internal security (PR #1740)
5154

5255
## version 0.6.1 - 2024-05-16 {#v0.6.1}
5356

starsky-tools/dropbox-import/package-lock.json

+7-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

starsky-tools/dropbox-import/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"update:install": "npx --yes npm-check-updates -u && npm install"
1111
},
1212
"dependencies": {
13-
"axios": "^1.7.4",
13+
"axios": "^1.7.7",
1414
"dotenv": "^16.4.5"
1515
},
1616
"author": "",

starsky-tools/end2end/.eslintrc.js

-25
This file was deleted.

starsky-tools/end2end/cypress/e2e/02-login/02-login.cy.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { Config } from 'support/config'
12
import { envName, envFolder } from '../../support/commands'
23
import configFile from './config.json'
34
import flow from './flow.json'
4-
const config = configFile[envFolder][envName] as any
5+
const config = configFile[envFolder][envName] as Config
56

67
describe('Login (02)', () => {
78
beforeEach('Check some config settings and do them before each test (02)', () => {

starsky-tools/end2end/cypress/e2e/10-upload-to-folder/10-upload-to-folder.cy.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ describe('Upload to folder (10)', () => {
6363
cy.log('next upload 2')
6464

6565
cy.intercept('/starsky/api/upload', (req) => {
66-
req.headers['to'] = config.mkdirPath + "/" + fileName2,
67-
req.headers['to2'] = config.mkdirPath + "/" + fileName2
66+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
67+
req.headers.to = config.mkdirPath + "/" + fileName2,
68+
req.headers.to2 = config.mkdirPath + "/" + fileName2
6869

6970
}).as('upload2')
7071

starsky-tools/end2end/cypress/e2e/10-upload-to-folder/upload-filename1.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function uploadFileName1 (url: string, fileName1: string, check = true) {
1+
export function uploadFileName1 (url: string, fileName1: string) {
22
cy.visit(url)
33

44
cy.get('.item.item--more').click()

starsky-tools/end2end/cypress/e2e/21-archive-from-upload/from-upload.cy.ts

+49-95
Original file line numberDiff line numberDiff line change
@@ -64,54 +64,6 @@ describe('Archive (from upload) (21)', () => {
6464
).should('have.length', 1)
6565
})
6666

67-
it('test realtime update 2 websockets (21)', {
68-
retries: { runMode: 4, openMode: 2 }
69-
}, () => {
70-
return new Cypress.Promise((resolve) => {
71-
72-
// skip this test currently for windows
73-
74-
if (!config.isEnabled || Cypress.platform === 'win32') {
75-
cy.log(`test skipped isEnabled: ${config.isEnabled} platform: ${Cypress.platform}` )
76-
resolve();
77-
return;
78-
}
79-
80-
const sourceTags = 'tete de balacha, bergtop, mist, flaine'
81-
const url = Cypress.config().baseUrl
82-
const socketUrl =
83-
url
84-
.replace(config.url, '')
85-
.replace('http://', 'ws://')
86-
.replace('https://', 'wss://') + config.realtime
87-
const socket = new WebSocket(socketUrl)
88-
const keyword = `realtime-update-test${Math.floor(Math.random() * 100)}`
89-
90-
socket.onmessage = function (message: any) {
91-
if (
92-
message.data.includes(keyword) &&
93-
message.data.includes('/starsky-end2end-test/20200822_111408.jpg') &&
94-
message.data.includes('"type":"MetaUpdate"')
95-
) {
96-
resolve()
97-
}
98-
}
99-
100-
cy.request({
101-
method: 'POST',
102-
url: config.updateApi, // baseUrl is prepend to URL
103-
form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
104-
body: {
105-
append: false,
106-
collections: true,
107-
tags: keyword,
108-
f: '/starsky-end2end-test/20200822_111408.jpg'
109-
}
110-
})
111-
resetAfterwards(sourceTags)
112-
})
113-
})
114-
11567
it('test realtime update notification api 3 (21)', () => {
11668
if (!config.isEnabled) return
11769

@@ -135,8 +87,9 @@ describe('Archive (from upload) (21)', () => {
13587
url: config.notificationApi as string
13688
}).then((response3) => {
13789
const notification = response3.body as [{ content: string }]
90+
cy.log(notification[0].content)
13891

139-
const dataObjects: any[] = []
92+
const dataObjects: string[] = []
14093
for (const item1 of notification) {
14194
if (
14295
item1.content.includes(keyword) &&
@@ -160,52 +113,53 @@ describe('Archive (from upload) (21)', () => {
160113
resetAfterwards(sourceTags)
161114
})
162115

163-
// test fails always
164-
// xit('test realtime update (21)', {
165-
// retries: { runMode: 2, openMode: 2 }
166-
// }, async () => {
167-
// if (!config.isEnabled) return
168-
169-
// await new Cypress.Promise((resolve) => {
170-
// if (!config.isEnabled) return
171-
172-
// const sourceTags = 'tete de balacha, bergtop, mist, flaine'
173-
// const keyword = `realtime-update-test${Math.floor(Math.random() * 100)}`
174-
175-
// cy.window().should(({ window }) => {
176-
// window.document.body.addEventListener(
177-
// 'USE_SOCKETS',
178-
// (dataItem: any) => {
179-
// console.log(dataItem.detail.data)
180-
181-
// for (const item1 of dataItem.detail.data) {
182-
// if (
183-
// item1.tags.includes(keyword) &&
184-
// item1.filePath.includes(
185-
// '/starsky-end2end-test/20200822_111408.jpg'
186-
// )
187-
// ) {
188-
// resolve()
189-
// }
190-
// }
191-
// }
192-
// )
193-
194-
// cy.request({
195-
// method: 'POST',
196-
// url: config.updateApi, // baseUrl is prepend to URL
197-
// form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
198-
// body: {
199-
// append: false,
200-
// collections: true,
201-
// tags: keyword,
202-
// f: '/starsky-end2end-test/20200822_111408.jpg'
203-
// }
204-
// })
205-
// resetAfterwards(sourceTags)
206-
// })
207-
// })
208-
// })
116+
it('test realtime update 2 websockets (21)', {
117+
retries: { runMode: 4, openMode: 2 }
118+
}, () => {
119+
return new Cypress.Promise((resolve) => {
120+
121+
// skip this test currently for windows
122+
123+
if (!config.isEnabled || Cypress.platform === 'win32') {
124+
cy.log(`test skipped isEnabled: ${config.isEnabled} platform: ${Cypress.platform}` )
125+
resolve();
126+
return;
127+
}
128+
129+
const sourceTags = 'tete de balacha, bergtop, mist, flaine'
130+
const url = Cypress.config().baseUrl
131+
const socketUrl =
132+
url
133+
.replace(config.url, '')
134+
.replace('http://', 'ws://')
135+
.replace('https://', 'wss://') + config.realtime
136+
const socket = new WebSocket(socketUrl)
137+
const keyword = `realtime-update-test${Math.floor(Math.random() * 100)}`
138+
139+
socket.onmessage = function (message: {data: string}) {
140+
if (
141+
message.data.includes(keyword) &&
142+
message.data.includes('/starsky-end2end-test/20200822_111408.jpg') &&
143+
message.data.includes('"type":"MetaUpdate"')
144+
) {
145+
resolve()
146+
}
147+
}
148+
149+
cy.request({
150+
method: 'POST',
151+
url: config.updateApi, // baseUrl is prepend to URL
152+
form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
153+
body: {
154+
append: false,
155+
collections: true,
156+
tags: keyword,
157+
f: '/starsky-end2end-test/20200822_111408.jpg'
158+
}
159+
})
160+
resetAfterwards(sourceTags)
161+
})
162+
})
209163

210164
function resetAfterwards (sourceTags: string): void {
211165
cy.log('next step: reset afterwards')

starsky-tools/end2end/cypress/e2e/22-create-rename-directory/22-create-directory.cy.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe("Create Rename Dir (22)", () => {
8282

8383
cy.visit(config.apiEnvEndpoint, {
8484
headers: {
85-
"x-force-html": true,
85+
"x-force-html": "true",
8686
},
8787
});
8888
cy.get("body")
@@ -218,7 +218,7 @@ describe("Create Rename Dir (22)", () => {
218218

219219
cy.request(config.apiTrash).then((response) => {
220220
const message = response.body.fileIndexItems.find(
221-
(x: any) =>
221+
(x: {filePath: string}) =>
222222
x.filePath === "/starsky-end2end-test/z_test_auto_created_update"
223223
);
224224
if (
@@ -238,7 +238,7 @@ describe("Create Rename Dir (22)", () => {
238238

239239
cy.request(config.apiTrash).then((response2) => {
240240
const message2 = response2.body.fileIndexItems.find(
241-
(x: any) =>
241+
(x: {filePath: string}) =>
242242
x.filePath === "/starsky-end2end-test/z_test_auto_created_update"
243243
);
244244
if (

starsky-tools/end2end/cypress/e2e/30-search/31-search-from-upload.cy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { envName, envFolder } from '../../support/commands'
22
import configFile from './config.json'
3-
import flow from './flow.json'
43
const config = configFile[envFolder][envName]
54

65
describe('Search -from upload (31)', () => {

starsky-tools/end2end/cypress/e2e/30-search/32-search-tags-update-from-upload.cy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { envName, envFolder } from '../../support/commands'
22
import configFile from './config.json'
3-
import flow from './flow.json'
43
const config = configFile[envFolder][envName]
54

65
describe('Search -from upload - update tags (32)', () => {

starsky-tools/end2end/cypress/e2e/40-detailview-from-upload/detailview-from-upload.cy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { uploadFileName1 } from 'integration/10-upload-to-folder/upload-filename1'
21
import { envName, envFolder } from '../../support/commands'
32
import configFile from './config.json'
43
import flow from './flow.json'

0 commit comments

Comments
 (0)