Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: changing permission verify strategy #1374

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
31feb4a
feat: changing permission verify strategy
thegrannychaseroperation Jan 2, 2025
1cfe3dc
Merge branch 'main' into feature/check-directory-permission
thegrannychaseroperation Jan 2, 2025
1f42ebd
fix: ensure ipcHandles are loaded before create window
zamitto Jan 2, 2025
71decd9
feat: show featurebase dropdown changelog on bottom panel version
zamitto Jan 3, 2025
99364df
Merge branch 'main' into feature/check-directory-permission
zamitto Jan 3, 2025
0adcc73
feat: add optional game params back
zamitto Jan 5, 2025
74d4975
feat: handle open new browser window on link
zamitto Jan 5, 2025
9bb89a1
feat: remove unnecessary userPreferences findOne
zamitto Jan 5, 2025
47f7731
feat: prefer to play achievement sound in browser window if available
zamitto Jan 5, 2025
715c4a6
feat: update user language
zamitto Jan 5, 2025
92e641e
feat: sonar suggestions
zamitto Jan 5, 2025
097aff1
feat: delete hydra.db if migrations are corrupted
zamitto Jan 5, 2025
f682c56
feat: use fs already imported
zamitto Jan 5, 2025
fb66557
feat: reduce python log level
zamitto Jan 5, 2025
40552cb
Merge branch 'main' into feature/check-directory-permission
zamitto Jan 5, 2025
540fd80
feat: add featureBaseJwt to type
zamitto Jan 5, 2025
5ac0c04
fix: error handling
zamitto Jan 6, 2025
1d8a3c4
feat: undo knex error handling
zamitto Jan 6, 2025
1b4f962
feat: updating title bar z-index
thegrannychaseroperation Jan 6, 2025
abf9d9b
Merge branch 'feature/check-directory-permission' of github.com:hydra…
thegrannychaseroperation Jan 6, 2025
3f8a440
feat: adjust python log file
zamitto Jan 7, 2025
33e1de7
feat: check for updates every 60 minutes
zamitto Jan 7, 2025
16a3b1e
Merge branch 'main' into feature/check-directory-permission
zamitto Jan 7, 2025
8ef2377
feat: i18n
zamitto Jan 7, 2025
e4fefde
Merge branch 'main' into feature/check-directory-permission
thegrannychaseroperation Jan 10, 2025
8f1acb4
fix: missing first call on check for updates
zamitto Jan 10, 2025
5889f62
feat: add network logger file
zamitto Jan 10, 2025
04db9a7
feat: refactor check for updates to run loop on main process
zamitto Jan 11, 2025
64b10a0
feat: remove python log change
zamitto Jan 11, 2025
ce223a4
feat: update hook dependency
zamitto Jan 11, 2025
6698d2f
feat: remove unneeded async
zamitto Jan 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/main/events/hardware/check-folder-write-permission.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import fs from "node:fs";
import path from "node:path";

import { registerEvent } from "../register-event";

const checkFolderWritePermission = async (
_event: Electron.IpcMainInvokeEvent,
path: string
) =>
new Promise((resolve) => {
fs.access(path, fs.constants.W_OK, (err) => {
resolve(!err);
});
});
testPath: string
) => {
Comment on lines 6 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: function is marked async but contains no await operations - should either use async fs operations or remove async keyword

const testFilePath = path.join(testPath, ".hydra-write-test");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: consider using a more unique filename with timestamp/uuid to avoid potential conflicts


try {
fs.writeFileSync(testFilePath, "");
fs.rmSync(testFilePath);
Comment on lines +13 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: using synchronous fs operations can block the main thread - consider using async writeFile/rm

return true;
} catch (err) {
return false;
}
Comment on lines +16 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: error is silently swallowed - should at least log it for debugging purposes

};

registerEvent("checkFolderWritePermission", checkFolderWritePermission);
Loading