-
-
Notifications
You must be signed in to change notification settings - Fork 48
Attempt fixing #240 #261
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
base: next
Are you sure you want to change the base?
Attempt fixing #240 #261
Conversation
qgustavor
commented
Sep 3, 2025
- Fix .downloadId handling
- Attempt adding a unit test for that
- Realize mega-mock doesn't handle sharing yet and have to skip the test
- Fix a warning in the tests by replacing shell: true with cross-spawn
1. Fix .downloadId handling 2. Attempt adding a unit test for that 3. Realize mega-mock doesn't handle sharing yet and have to skip the test 4. Fix a warning in the tests by replacing shell: true with cross-spawn
|
@cyperdark Since I could not test this issue using unit testing, can you checking if this fix looks correct (and, if possible, test it)? Edit: BTW, I don't mean I didn't test it, but I just tried it with a single test case, which may be prone and, since I wrote it, maybe I have skipped something. I'm human after all (and I don't trust AI to do that). |
|
did a small script to compare links in account and on website
Draw Skin 1.3.osk:
in account
--- https://mega.nz/file/3EYzGJYD#n10rKwpykh31pXZzsp8pNrYGTYp6Sp6uvmxMvBjHdAw
+++ https://mega.nz/file/eFBAAbBA#n10rKwpykh31pXZzsp8pNrYGTYp6Sp6uvmxMvBjHdAw
on website
--- https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/eFBAAbBA
+++ https://mega.nz/file/eFBAAbBA#n10rKwpykh31pXZzsp8pNrYGTYp6Sp6uvmxMvBjHdAw
Draw Skin 1.3_ultra_lite.osk:
in account
--- https://mega.nz/file/KVYAjB7Z#oqLheFMBn08thwUF7tPSs9W9Ev-6u2dt8gY7hLUWHHY
+++ https://mega.nz/file/zVIADbzK#oqLheFMBn08thwUF7tPSs9W9Ev-6u2dt8gY7hLUWHHY
on website
--- https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/zVIADbzK
+++ https://mega.nz/file/zVIADbzK#oqLheFMBn08thwUF7tPSs9W9Ev-6u2dt8gY7hLUWHHY
Draw Skin 1.3_extra.zip:
in account
--- https://mega.nz/file/LJw0gYDC#O7nKMQamR14ca3JSaS2k6EXtYDi04xtB3xk8-TdFu-Q
+++ https://mega.nz/file/mBIilB7S#O7nKMQamR14ca3JSaS2k6EXtYDi04xtB3xk8-TdFu-Q
on website
--- https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/mBIilB7S
+++ https://mega.nz/file/mBIilB7S#O7nKMQamR14ca3JSaS2k6EXtYDi04xtB3xk8-TdFu-Q
folder url
--- https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA
+++ https://mega.nz/folder/jQAQkCba#0U0BKQQFqJMm0tcNztFopgimport { File } from 'megajs';
const links_in_account: any = {
'Draw Skin 1.3.osk': 'https://mega.nz/file/3EYzGJYD#n10rKwpykh31pXZzsp8pNrYGTYp6Sp6uvmxMvBjHdAw',
'Draw Skin 1.3_ultra_lite.osk': 'https://mega.nz/file/KVYAjB7Z#oqLheFMBn08thwUF7tPSs9W9Ev-6u2dt8gY7hLUWHHY',
'Draw Skin 1.3_extra.zip': 'https://mega.nz/file/LJw0gYDC#O7nKMQamR14ca3JSaS2k6EXtYDi04xtB3xk8-TdFu-Q',
};
const links_on_website: any = {
'Draw Skin 1.3.osk': 'https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/eFBAAbBA',
'Draw Skin 1.3_ultra_lite.osk': 'https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/zVIADbzK',
'Draw Skin 1.3_extra.zip': 'https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA/file/mBIilB7S',
};
async function parse_mega(url: string) {
try {
const folder = await File.fromURL(url).loadAttributes();
const array = folder.children || [];
console.log('```diff');
for (let i = 0; i < array.length; i++) {
const file = array[i];
console.log(`${file.name}:`);
console.log('in account');
console.log('---', links_in_account[file.name!]);
console.log('+++', await file.link({ key: file.key! }));
console.log('');
console.log('on website');
console.log('---', links_on_website[file.name!]);
console.log('+++', await file.link({ key: file.key! }));
console.log('\n');
};
console.log('folder url');
console.log('---', url);
console.log('+++', await folder.link({ key: folder.key! }));
console.log('```');
} catch (error) {
console.log('mega', error);
};
};
parse_mega('https://mega.nz/folder/jQAQkCba#PdM_L91G4PVLCUx4fPWVrA');edit: used local build with pr changes |
|
I guess I have to fix that and implement sharing on mega-mock so we can unit test that. |