openpgpjs / openpgpjs/web-stream-tools

addEventListener support for Reader

Open
#5 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
35
Forks
15
Avg merge
1h 23m
Merged PRs (30d)
1

Description

Couldn't the reader returned by getReader() implement the FileReader interface or is there another way to "track" reader progress outside a while loop?

var { message } = await openpgp.encrypt({
        message: openpgp.message.fromBinary((new File([], "foo.txt")).stream()),
        publicKeys: [KEYS],
        armor: false
    }),
_reader = openpgp.stream.getReader(message.packets.write());
_reader.addEventListener('progress', event => console.log(`${event.type}: ${event.loaded} bytes transferred`));

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the getReader entry point used by openpgp.stream.getReader(message.packets.write()) and compare the requested addEventListener('progress') behavior with the FileReader interface. Determine what progress information the reader can expose and define completion by demonstrating progress tracking outside the while loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.