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

Replace request with fetch (and fix other bugs) #86

Merged
merged 101 commits into from
Feb 19, 2022
Merged

Commits on Jan 16, 2022

  1. Configuration menu
    Copy the full SHA
    486cd9d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    73bebc4 View commit details
    Browse the repository at this point in the history
  3. Replace rollup with esbuild and update ava

    Now async/await support is required for building.
    As esbuild do not compile to ES5 old browsers are not supported at this moment.
    Tests are failing, probably the code that handles uploading got broken in 486cd9d.
    qgustavor committed Jan 16, 2022
    Configuration menu
    Copy the full SHA
    a5a7246 View commit details
    Browse the repository at this point in the history
  4. Fix failing tests

    qgustavor committed Jan 16, 2022
    Configuration menu
    Copy the full SHA
    bd3ea5f View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2022

  1. Some fixes

    Update Travis Node versions.
    Make the API easier to be overridden.
    Use a default user-agent and HTTP(S) agent.
    Implement again single-connection downloading as is the only reliable way to download at the moment.
    Fix the browser version to, at least, load file attributes.
    qgustavor committed Jan 17, 2022
    Configuration menu
    Copy the full SHA
    2ca44c2 View commit details
    Browse the repository at this point in the history
  2. Try to fix issues while downloading

    And remove Node 14 from Travis. I don't know why it's failing and I don't want to fix it.
    qgustavor committed Jan 17, 2022
    Configuration menu
    Copy the full SHA
    48248e2 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2022

  1. I should have been commiting more often

    The idea behind those changes is removing Babel dependencies by making Ava work using ES modules, but them I had to rename everything from .js to .mjs. I could add type: 'module' to package.json but them I think it could cause some issues to users of the library that were using it as a commonjs module.
    
    Well, now the source code is a es module that can be run without any compiling. I wonder if would be better to just export the source code as the module build and just compile for cjs and browsers/deno. Better not: currently using esbuild allows to switch to typescript quite easily.
    
    Browser tests removed: they were doing nothing important, just testing pure-javascript fallbacks, but currently the browser build is failing because the browser version of streams is not working well. Will be replaced with Deno based tests later as Deno is quite close to browsers but do not have the issue of being as slow and resource intensive as a browser.
    
    Moved from Travis to Github Actions.
    qgustavor committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    36e9fe2 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2022

  1. Add note about MAC implementation

    Just a reminder to myself that implementing MEGA's weird MAC using native functions is not only hard, but makes the code run slower (at least on Node 16).
    
    It's similar to this: https://en.wikipedia.org/wiki/CBC-MAC
    
    But there is a small change on this that makes things harder: the computation result is added to a second ECBC-MAC and the main one resets every chunk.
    
    Also, for some reason, trying to remove this.macs = [] by calculating the final mac in the checkMacBounding function made it slower too. The bad thing is that it increases memory usage, a 16 byte Buffer every 1 MB or so.
    
    If someone wants to fix those things, do the benchmarks and send a pull request.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    d3b3c81 View commit details
    Browse the repository at this point in the history
  2. Separate authentication from encryption

    Fixes #29. Finally. After FOUR years.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    17db83a View commit details
    Browse the repository at this point in the history
  3. Lock out, lock in

    Package-lock.json was removed because Travis on 04cd018.
    
    It's returning because GitHub Actions.
    
    I hope it don't start causing issues again. Otherwise I will return to Travis!
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    3bf81ff View commit details
    Browse the repository at this point in the history
  4. Attempt to fix #83

    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    4aec3be View commit details
    Browse the repository at this point in the history
  5. Fix the issue with Node 14

    I expected to Github Actions to be better.
    And it is: now I know why Node 14 was failing.
    Or not, it should not, before Babel was compiling the code
    so the require "hack" was not an issue.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    261d118 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b9b168b View commit details
    Browse the repository at this point in the history
  7. Attempt to fix #54

    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    c1ebb33 View commit details
    Browse the repository at this point in the history
  8. Attempt to fix #84

    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    5afdac4 View commit details
    Browse the repository at this point in the history
  9. Remember to use the linter

    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    2ce9485 View commit details
    Browse the repository at this point in the history
  10. The fix for #84 is going to break some code

    But is needed for the greater well being of everyone
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    e90184b View commit details
    Browse the repository at this point in the history
  11. Fix issue when source is not defined

    Also reduce timeout duration, it was too long.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    76c35e7 View commit details
    Browse the repository at this point in the history
  12. Move test helper to a folder

    Tests will be built using esbuild and this file will be replaced with a Deno compatible version when testing.
    
    By compiling using esbuild migrating to Typescript should be easier.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    c10d130 View commit details
    Browse the repository at this point in the history
  13. Fix build and test built code

    Storage and stream encryption tests can be run on built code, other tests will need to be compiled from source.
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    a85357c View commit details
    Browse the repository at this point in the history
  14. Implement verify test

    Also export stream.mac (otherwise implementing this test would be quite a headache).
    qgustavor committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    df68697 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    01ff7f4 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6832571 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2022

  1. Setup multiple runtime test environment

    Tests are failing due to multiple issues such as:
    - Standard do not support top level await (it's in the works)
    - A replacement for Ava in Deno with the same API is missing
    - For some reason Ava is not finding the built tests
    qgustavor committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    72024bd View commit details
    Browse the repository at this point in the history
  2. Fix tests

    Rewrite tests to not depend on mega-mock.
    Check mega-mock state by hashing its internal state them verifying
    (it should be consistent between runs).
    Implement Ava compatibility layer for Deno.
    Remove t.plan() usage as it seem hard to implement in the compatibility layer.
    Also fix some issues in the runner.
    
    All Deno tests are failing.
    qgustavor committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    6fb0b85 View commit details
    Browse the repository at this point in the history
  3. Fix some issues found in Deno tests

    A process.nextTick shim was needed.
    Some old dependencies - "through", "stream-combiner" and "combined-stream" - had to be replaced with modern alternatives.
    
    Also
    Export a null Agent in noop.mjs to silent esbuild warnings.
    Improve development builds.
    
    Storage tests are failing for some reason, probably the upload method is broken. Downloading is now fixed in Deno and browsers.
    qgustavor committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    443ebaf View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2022

  1. Configuration menu
    Copy the full SHA
    1286a25 View commit details
    Browse the repository at this point in the history
  2. Fix tests

    test/helpers/test-runner.mjs is ignored in Standard temporally until it support top level await.
    qgustavor committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    8153a3e View commit details
    Browse the repository at this point in the history
  3. Fix zero length file uploading and add tests

    Deno tests broke for some reason.
    qgustavor committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    595527a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e9345bc View commit details
    Browse the repository at this point in the history
  5. Fix dumb mistake

    Yeah. That was dumb.
    qgustavor committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    6dcbf1f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    146583e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a352c89 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2022

  1. Trying to solve test issues in CI by the third time

    Change to cjs because Node V14
    Also I had forgotten to publish the fix in mega-mock...
    qgustavor committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    f2406a3 View commit details
    Browse the repository at this point in the history
  2. Trying to solve test issues in CI by the fourth time

    Make cjs change depend on AbortController support
    Deno don't add a content-length header for empty bodies
    Login test will always lack
    Also tried fixing the verify test from callback to promise (and turned that it was fine)
    qgustavor committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    18cd48e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b47796a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9c77606 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2022

  1. Simplify entry name

    The extension already shows that it's the ESM entry point.
    qgustavor committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    ed069d6 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2022

  1. Configuration menu
    Copy the full SHA
    15366de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    27758dd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    70ece83 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1f93edd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8c636c3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    830240e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    670cfe1 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2022

  1. Configuration menu
    Copy the full SHA
    557ab9d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b928d6f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b8b36c1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1c46314 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2022

  1. Configuration menu
    Copy the full SHA
    a5babca View commit details
    Browse the repository at this point in the history
  2. Update readme

    qgustavor committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    89e5d05 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2022

  1. Configuration menu
    Copy the full SHA
    d7ced10 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2022

  1. Added missing types

    ChampionBuffalo1 committed Feb 5, 2022
    Configuration menu
    Copy the full SHA
    23081d6 View commit details
    Browse the repository at this point in the history
  2. Handle callback, API and sharing issues

    Setting userAgent to null will disable the user-agent header. At the moment it is needed in Firefox until Mega allows the user-agent header to be set in API requests.
    
    User-agent and http agents are correctly accepted as API arguments
    
    The unshare file method was implemented.
    
    Logout callback is optional as before it didn't had a callback.
    qgustavor committed Feb 5, 2022
    Configuration menu
    Copy the full SHA
    688c56b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    849dc73 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2022

  1. Configuration menu
    Copy the full SHA
    3470343 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e757775 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c84246 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6566698 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5366934 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a5907d0 View commit details
    Browse the repository at this point in the history
  7. Add promise support and tests

    Some tests: the only promisied function tested is mkdir and in order to test the other functions mega-mock needs to be updated.
    qgustavor committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    4696c9c View commit details
    Browse the repository at this point in the history
  8. Simplify implementation

    Functions calling promisified functions don't need extra promisification.
    The multipleArgs was never used.
    qgustavor committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    6c84c84 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2022

  1. Configuration menu
    Copy the full SHA
    602e436 View commit details
    Browse the repository at this point in the history
  2. Added Promise type

    ChampionBuffalo1 committed Feb 7, 2022
    Configuration menu
    Copy the full SHA
    9908031 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    014cece View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2022

  1. Configuration menu
    Copy the full SHA
    743d84c View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2022

  1. Fixed wrong types

    ChampionBuffalo1 committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    e2a0c9b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    734e1e1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7dce3b3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    244f143 View commit details
    Browse the repository at this point in the history
  5. Finished implementing promises

    Also fixed some types
    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    4d75545 View commit details
    Browse the repository at this point in the history
  6. 1.0.0-alpha.0

    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    aec2760 View commit details
    Browse the repository at this point in the history
  7. Switch to ts-standard

    test/helpers/test-runner.mjs had to be ignored again. Also fix some issues ts-standard found.
    
    Is a good thing that TypeScript still works without those ugly semicolons :)
    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    3f06b60 View commit details
    Browse the repository at this point in the history
  8. Refresh package-lock.json

    Seems it will solve the issue with Node 14.
    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    428c73e View commit details
    Browse the repository at this point in the history
  9. Attempt fix on Node 14

    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    2e71fff View commit details
    Browse the repository at this point in the history
  10. Revert "Attempt fix on Node 14"

    This reverts commit 2e71fff.
    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    66e99f1 View commit details
    Browse the repository at this point in the history
  11. Try to fix testing again

    - Restore standard and use it for .js files
    - Use ts-standard only for index.d.ts
    - Split testing tasks which will allow the below
    - Do not lint TypeScript on Node 14
    - Made the test runner default to Node to make the library more friendly to new contributors
    - Removed the now unneeded note in the readme.
    qgustavor committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    03de0c2 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2022

  1. Configuration menu
    Copy the full SHA
    b4cfff7 View commit details
    Browse the repository at this point in the history
  2. 1.0.0-alpha.1

    qgustavor committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    439728b View commit details
    Browse the repository at this point in the history
  3. Fix typings

    And remove `return this`
    qgustavor committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    96bdff0 View commit details
    Browse the repository at this point in the history
  4. 1.0.0-alpha.2

    qgustavor committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    6949e51 View commit details
    Browse the repository at this point in the history
  5. Add ESM types and fix CJS types

    For some reason ts-typescript is not working with the ESM types:
    "Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser."
    
    Because of that this file is not being linted at the moment.
    qgustavor committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    2ca0933 View commit details
    Browse the repository at this point in the history
  6. 1.0.0-alpha.3

    qgustavor committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    5b0cec6 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2022

  1. Configuration menu
    Copy the full SHA
    48c7b57 View commit details
    Browse the repository at this point in the history
  2. 1.0.0-alpha.4

    qgustavor committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    a56b683 View commit details
    Browse the repository at this point in the history
  3. Fixes and improvements

    - Handle AbortError in the API
    - Make stream errors synchronous
    - Support single-stream download in browser/Deno
    - Handle download cancelling in single-stream downloading
    - Remove unneeded process.nextTick since promises are being used
    - Simplify promisify function
    - Add tests
    qgustavor committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    52b72c9 View commit details
    Browse the repository at this point in the history
  4. 1.0.0-alpha.5

    qgustavor committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    17778a0 View commit details
    Browse the repository at this point in the history
  5. Handle closing better

    If you call sml while connections are still open then they will return ESID.
    But aborting is not enough, so API ignores responses after it was been closed.
    qgustavor committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    afc8db5 View commit details
    Browse the repository at this point in the history
  6. 1.0.0-alpha.6

    qgustavor committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    33cd0eb View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

  1. Remove pauseStream

    Also fix bandwidth limit error and error handling when using streams.
    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    bac52ce View commit details
    Browse the repository at this point in the history
  2. Attempt fixing upload and download errors

    There is still an issue that's causing issues in Deno and browsers, for some reason chunks are being read out of order randomly.
    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    f45fd5c View commit details
    Browse the repository at this point in the history
  3. Fix downloading

    Wrong variable. Also handle backpressure.
    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    8029bcb View commit details
    Browse the repository at this point in the history
  4. 1.0.0-alpha.7

    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    3245255 View commit details
    Browse the repository at this point in the history
  5. Fix types

    Children and parent were missing. MutableFile class is not exported.
    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    cfffe33 View commit details
    Browse the repository at this point in the history
  6. 1.0.0-alpha.8

    qgustavor committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    1d534af View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2022

  1. Fix abort handling

    qgustavor committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    9b88cc8 View commit details
    Browse the repository at this point in the history
  2. 1.0.0-alpha.9

    qgustavor committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    41bd26c View commit details
    Browse the repository at this point in the history
  3. Attempt fix for promise never resolving

    Fix potential race condition.
    Split upload and download tests.
    qgustavor committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    d5bc057 View commit details
    Browse the repository at this point in the history
  4. 1.0.0-alpha.10

    qgustavor committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    28dcae1 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2022

  1. 1.0.0

    qgustavor committed Feb 19, 2022
    Configuration menu
    Copy the full SHA
    f1a34fc View commit details
    Browse the repository at this point in the history