numbersprotocol / numbersprotocol/capture-cam

Reduce redundant querying/loading and reuse loaded resource on Capture Details and its sub-pages

Open
#552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
26
Forks
7
Avg merge
2d 14h
Merged PRs (30d)
10

Description

Concept

Actions like loading a full resolution image from base64 data URI is costly. Querying from repository could hurt performance as well. There's much room for improvement to reduce the time for a page to be fully loaded.

Reason/Hypothesis

The capture-details page and some of its subpages uses the exactly same resource, such as the full resolution image, the Proof object, the DiaBackendAsset object fetched from backend, etc.

Currently, every resource that takes non-trivial time loading is not shared between these pages, and would cause very obvious performance impact. It also forces a lot of repeated code for building the observables and doing type guarding.

To see the case, go to the capture-details page and wait for the image to load. Now click on send button to go to the sending-post-capture page. Even though the image shown is exactly the same, it still need a completely reload.

Suggested Implementation (if any)

  1. Base64 data URI is too long to be passed in router parameter. Might try file system path or webpath.
  2. Some page might not need to actually be separated pages. If some pages uses similar resources, they could be merged into a single page with multiple page state.

┆Issue is synchronized with this Asana task by Unito

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 by tracing resource loading across the capture-details and sending-post-capture pages, focusing on the full-resolution image, Proof object, and DiaBackendAsset object. Compare how these resources are loaded when navigating between the pages; done means shared resources no longer trigger redundant loading or querying and the image does not reload unnecessarily.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.