Skip to content

Encrypted image handling parity: inline display + correct decryption (Qortal Extension) #5

Description

@QuickMythril

Summary

Encrypted images sent in Q-Chat (PMs and private groups) decrypt and display correctly in Hub, but fail in both Qortal Go and the Chrome Extension.

Symptoms:

  • Images show "Unable to decrypt" or never render.
  • Inline display fails even though raw encrypted attachments exist.
  • Preview/full-size display is missing or broken.

This issue tracks full parity for encrypted image support across Mobile and Extension.

⚠️ This is a functional interoperability bug, not just a UX polish item.
Users on Mobile and Extension must be able to see encrypted chat images the same way Hub users can.


Current Behavior

Hub (reference)

  • Correctly:
    • Uploads encrypted images using group/PM encryption keys.
    • Fetches image bytes from Core via /chat/attachment/...
    • Core decrypts using the user's keys.
    • Hub displays images inline + full-size modal.
  • Group encryption model allows new members to decrypt older images.

Mobile (Go)

From analysis in go_implementation_plan.md:

  • Attachment decrypt path likely not calling the correct Qortal API method.
  • Fetch logic may be using QDN URL directly instead of Core's decrypt endpoint.
  • RN image component cannot render because it receives undecrypted bytes or errors.
  • No full-screen viewer implemented.

Chrome Extension

From chrome_extension_implementation_plan.md:

  • Similar pattern: fetches encrypted bytes raw, without Core decrypt.
  • Some logic attempts base64 decode directly in JS (which will fail).
  • No inline <img> renderer for decrypted blobs.
  • “Unable to decrypt” errors common.

Target Behavior (Parity with Hub)

Across both Mobile and Extension:

  • Encrypted images:
    • Fetch through Qortal Core, not via raw QDN URL.
    • Decrypt using the user's identity keys (Core handles this automatically).
    • Render inline in chat using normal image components.
  • Messages with images must:
    • Show a thumbnail-size inline preview.
    • Open full-screen viewer/modal on tap/click.
  • Failure states:
    • If decrypt fails, show a clean fallback (“Unable to decrypt image”), not a broken layout.
  • UX constraints:
    • Chat scrolling must remain smooth even with images.
    • Cached images should reuse blob/URI after first fetch.

Acceptance Criteria

Fetch & Decrypt

  • Mobile: qortalRequest({ action:"GET_IMAGE", ... }) or equivalent decrypt-enabled endpoint is used.
  • Extension: uses Core’s decrypting fetch path via the background script or direct API.
  • Both apps receive decrypted bytes (blob/base64) ready for <Image> or <img> display.
  • No direct QDN URL fetches for encrypted images.

Inline Display

  • Image renders inline in the message list.
  • Respects layout sizing (max-width, aspect ratio).
  • Scrolling performance is acceptable.

Full-Size Preview

  • Mobile: tap image → open full-screen preview (modal or screen).
  • Extension: click image → preview modal.

Error Handling

  • If decrypt fails, show a predictable fallback UI.
  • No red console errors in Extension.
  • No RN red screens on Mobile.

Compatibility Tests

  • Image sent from Hub → visible in Mobile + Extension.
  • Image sent from Mobile (once supported) → visible in Hub + Extension.
  • Group-images decrypt for new members after joining.

How to Test

  1. Use two identities: one on Hub, one on the test app.
  2. Send encrypted image (private group or PM).
  3. Confirm:
    • Inline shows image,
    • Full-size viewer works,
    • Fallback appears on invalid content,
    • New group member can decrypt past images.
  4. Test on:
    • Android device,
    • Chrome + Chromium-based browser.

Links

  • Trifecta parity matrix: (from uploaded report)
    Encrypted images = Broken/Divergent on Go & Extension

  • Implementation plans:

    • /mnt/data/go_implementation_plan.md
    • /mnt/data/chrome_extension_implementation_plan.md
  • Related features already completed: avatars, node status, context menus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Testing

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions