Open
Conversation
Owner
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
Owner
Author
|
@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 |
Owner
Author
|
I guess I have to fix that and implement sharing on mega-mock so we can unit test that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.