Skip to content

RFC-0013: Favourites API#141

Closed
filvecchiato wants to merge 1 commit into
release/0.7from
rfc/0013-favourites-api
Closed

RFC-0013: Favourites API#141
filvecchiato wants to merge 1 commit into
release/0.7from
rfc/0013-favourites-api

Conversation

@filvecchiato

@filvecchiato filvecchiato commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

RFC: Favourites API

Summary

Expose the host's local product catalogue to products. Three new methods: host_favourites_subscribe (reactive list), host_favourites_add (bookmark a product), and host_favourites_forget (remove a bookmark). Browse receives implicit privileged access.

Checklist

  • Added docs/rfcs/0013-favourites-api.md with completed frontmatter
  • Filled all RFC sections (Summary, Motivation, Detailed Design, Drawbacks, Alternatives, Unresolved Questions)
  • Updated docs/rfcs/_index.md with a link to the new RFC
  • Added labels: rfc, proposal

Motivation

Browse (on-chain discovery product) cannot display which apps the user has bookmarked or offer inline add/forget controls, because the host's product catalogue is locked in IndexedDB. This RFC exposes the catalogue through the Host API so any permitted product can read and manage favourites.

@filvecchiato filvecchiato added rfc Request For Change proposal labels Apr 21, 2026
@filvecchiato filvecchiato requested a review from BigTava April 21, 2026 17:03

@BigTava BigTava left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!


## Summary

Products can query, add and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the installed-product list and two mutations for adding/removing entries. Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt.

We should mention why? Because it is our default discovery product.


## Motivation

The host maintains a local catalogue of products the user has bookmarked (starred). Today this data lives in the host's IndexedDB and is inaccessible to products. Browse — the primary discovery surface — cannot show which apps are already installed or let the user bookmark new ones without direct database access.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could start by mentioning that hosts store data the products don't have access to, but would benefit from. Bookmarked apps is one such example.

The host maintains

We have three hosts today, Polkadot Desktop, Polkadot Web, and Polkadot Mobile, but only Desktop has bookmarks. Maybe rephrase to "Some hosts maintain".


Exposing this catalogue:

1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very generic


1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline.
2. **Keeps the host authoritative** — mutations go through the host, which owns the storage schema and can enforce invariants.
3. **Supports other products** — any product with permission can read the installed list (e.g. a dashboard, launcher, or analytics tool).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'd also tie this to DotNS being permissionless, anyone can publish a product, so discovery is essential. Browse and other products should also be able to help users find and keep track of apps that solve their problems.

}
```

This mirrors the existing `ProductRecord` in the host's `products` table, exposing only the fields relevant to products.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest starting with this sentence, and link to the relevant lines of code in polkadot-desktop as an example.

- **Full-list delivery.** No pagination or filtered subscriptions. Acceptable for typical catalogue sizes (tens to low hundreds).
- **Browse coupling.** Implicit privilege for Browse assumes a well-known product identity. If Browse's DotNS identifier changes, the host must update its allowlist.

## Alternatives

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a straightforward API in my opinion, we can remove

Comment on lines +113 to +115
## Unresolved Questions

1. **Batch operations.** Should `host_favourites_add` accept multiple product IDs?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of a use case for this, but worth keeping it in mind.

### API

```rust
enum FavouritesErr {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return a specific error if the Host doesn't have a favourites table?

@filvecchiato

Copy link
Copy Markdown
Contributor Author

closed in favour of paritytech/truapi#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal rfc Request For Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants