Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.4] - 2026-10-27

- Fix: Version 1.0.3 could archive active one-to-one and private conversations on its own. This no longer happens. If 1.0.3 archived some of your chats, open your archived conversations and un-archive them; nothing in them was lost.
- Fix: In some group chats, every message from a particular member was invisible to everyone, that member included — their messages seemed to vanish right after sending. The messages were delivered all along and now show. Members whose name the chat does not know yet appear as "Unknown member", and the app now repairs your own entry in any chat where it was missing.
- Feat: The app now tells you when a new version is available. On Windows, macOS and the Linux AppImage you can install it from inside the app; on Android it opens F-Droid, and on Ubuntu Touch the OpenStore.
- Feat: Your message history and the images in your conversations, archived ones included, are now saved too, so they can come with you into the next major update. This happens automatically in the background and only adds new messages and images after the first run.
- Fix: The saved copy of your account is now readable only by your own user on Linux and macOS.
Expand Down
60 changes: 60 additions & 0 deletions tests/src/relay/relay/profile.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { assert, test } from "vitest";

import { runScenario } from '@holochain/tryorama';
import { Record } from '@holochain/client';

const testAppPath = process.cwd() + '/../workdir/relay.happ';
const appSource = { appBundleSource: { type: "path", value: testAppPath } };

// The app repairs a conversation that is missing your profile by checking for
// it with a local-only lookup and writing it when absent
// (ProfileStore.repairMyConversationProfiles). create_profile does not refuse a
// second profile, so that lookup must find a profile you wrote yourself, with
// no network at all — otherwise every launch would add another one.
test('own profile is found by a local-only lookup, and a missing one is reported as missing', async () => {
await runScenario(async scenario => {
const [alice] = await scenario.addPlayersWithApps([appSource]);
const cell = alice.cells[0];
const agent = cell.cell_id[1];

const before: Record | null = await cell.callZome({
zome_name: "profiles",
fn_name: "get_agent_profile",
payload: { input: agent, local: true },
});
assert.isNull(before, "no profile written yet");

await cell.callZome({
zome_name: "profiles",
fn_name: "create_profile",
payload: { nickname: "Alice", fields: {} },
});

const after: Record | null = await cell.callZome({
zome_name: "profiles",
fn_name: "get_agent_profile",
payload: { input: agent, local: true },
});
assert.ok(after, "own profile must be visible locally right after writing it");
});
});

test('create_profile accepts a second profile for the same agent', async () => {
// Documents why the repair must check before writing.
await runScenario(async scenario => {
const [alice] = await scenario.addPlayersWithApps([appSource]);
const cell = alice.cells[0];

await cell.callZome({
zome_name: "profiles",
fn_name: "create_profile",
payload: { nickname: "Alice", fields: {} },
});
const second: Record = await cell.callZome({
zome_name: "profiles",
fn_name: "create_profile",
payload: { nickname: "Alice", fields: {} },
});
assert.ok(second);
});
});
3 changes: 3 additions & 0 deletions ui/src/lib/AgentNickname.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@
<span class="font-bold">{$t("common.you")}</span>
{:else if nickname !== undefined}
<span class="font-bold">{nickname}</span>
{:else}
<!-- A member whose profile this conversation does not hold (yet). -->
<span class="font-bold">{$t("common.unknown_member")}</span>
{/if}
5 changes: 5 additions & 0 deletions ui/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@
// Initialize signal handler
createSignalHandler(relayClient, conversationStore, conversationMessageStore, onlinePeers);

// Background, never fatal: fill in your profile where a join left it out.
void profileStore.repairMyConversationProfiles().catch((e) => {
console.warn("[profile] repair failed", e);
});

isStoresSetup = true;
} catch (e) {
console.error("Failed to init stores", e);
Expand Down
39 changes: 10 additions & 29 deletions ui/src/store/ConversationMessageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,35 +99,16 @@ export function createConversationMessageStore(
const messages = createGenericKeyValueStore<Record<ActionHashB64, MessageExtended>>();
const paginationState = writable<Record<string, PaginationState>>({});

const { subscribe } = derived(
[messages, mergedProfileContactInviteStore],
([$messages, $mergedProfileContactInviteStore]) => {
const filteredMessages = Object.fromEntries(
$messages.list.map(([cellIdB64, messagesData]) => {
const profilesLoaded =
$mergedProfileContactInviteStore.data[cellIdB64] !== undefined;

const filtered = Object.entries(messagesData).filter(([, msg]) => {
if (!profilesLoaded) return true;
if (msg.message.message_type === MessageType.System) return true;

return (
$mergedProfileContactInviteStore.data[cellIdB64]?.[msg.authorAgentPubKeyB64] !==
undefined
);
});

return [cellIdB64, Object.fromEntries(filtered)];
}),
);

return {
data: filteredMessages,
list: Object.entries(filteredMessages),
count: Object.keys(filteredMessages).length,
};
},
);
// Every stored message is shown, whether or not its author has a profile in
// the conversation. Hiding unknown authors silenced members whose profile
// was never written into a conversation (a join can fail after the cell
// exists): their messages were delivered but invisible to everyone,
// themselves included. Unknown authors render as "Unknown member".
const { subscribe } = derived(messages, ($messages) => ({
data: Object.fromEntries($messages.list),
list: $messages.list,
count: $messages.list.length,
}));

async function initialize(): Promise<void> {
_log("initialize:start");
Expand Down
4 changes: 2 additions & 2 deletions ui/src/store/ConversationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function createConversationStore(client: RelayClient): ConversationStore
async function create(input: CreateConversationInput): Promise<CellIdB64> {
const cellInfo = await client.createConversation(input);
await client.setConfig(cellInfo.cell_id, input.config);
await client.setMyProfileForConversation(cellInfo.cell_id);
await client.ensureMyProfileForConversation(cellInfo.cell_id);

// just created the conversation so don't go to the network
const conversationExtended = await _makeConversationExtended(cellInfo, true);
Expand All @@ -85,7 +85,7 @@ export function createConversationStore(client: RelayClient): ConversationStore

async function join(input: Invitation): Promise<CellIdB64> {
const cellInfo = await client.joinConversation(input);
await client.setMyProfileForConversation(cellInfo.cell_id);
await client.ensureMyProfileForConversation(cellInfo.cell_id);

// joining the conversation so go to the network for the config
const conversationExtended = await _makeConversationExtended(cellInfo, false);
Expand Down
46 changes: 46 additions & 0 deletions ui/src/store/ProfileStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface ProfileStore extends GenericKeyKeyValueStore<ProfileExtended> {
initialize: () => Promise<void>;
createProfile: (val: CreateProfileInputUI) => Promise<void>;
updateProfile: (val: CreateProfileInputUI) => Promise<void>;
repairMyConversationProfiles: () => Promise<number>;
load: (key: CellIdB64, local: boolean) => Promise<void>;
subscribe: (
this: void,
Expand Down Expand Up @@ -158,6 +159,50 @@ export function createProfileStore(client: RelayClient): ProfileStore {
});
}

/**
* Write your profile into active conversations that do not hold it.
*
* Joining creates the conversation first and writes your profile into it as
* a second step. When that step failed — the app closed mid-join, a timeout —
* nothing retried it: the conversation stayed in your list while you were
* missing from its member list. Run once per launch.
*
* Only local data is checked: your own profile, if it exists, was written on
* this device, so a local miss is a real miss and the write never duplicates
* one. Archived conversations are skipped; they are repaired after being
* un-archived and the app restarted.
*
* @returns how many conversations were repaired
*/
async function repairMyConversationProfiles(): Promise<number> {
const myPubKey = client.client.myPubKey;
const myPubKeyB64 = encodeHashToBase64(myPubKey);

// No profile yet (first run, before creating one): nothing to copy.
const provisioned = await client.getRelayProvisionedCellInfo();
if (!(await client.getAgentProfile(provisioned.cell_id, myPubKey, true))) return 0;

let repaired = 0;
for (const cell of await client.getRelayClonedCellInfos()) {
if (!cell.enabled) continue;
const cellIdB64 = encodeCellIdToBase64(cell.cell_id);
try {
if (await client.getAgentProfile(cell.cell_id, myPubKey, true)) continue;

const record = await client.ensureMyProfileForConversation(cell.cell_id);
const profile = new EntryRecord<Profile>(record).entry;
if (profile) {
profiles.setKeyKeyValue(cellIdB64, myPubKeyB64, { profile, publicKeyB64: myPubKeyB64 });
}
repaired++;
console.log(`[profile] wrote missing profile into conversation ${cellIdB64.slice(0, 16)}`);
} catch (e) {
console.warn(`[profile] could not repair profile in ${cellIdB64.slice(0, 16)}`, e);
}
}
return repaired;
}

async function load(key: CellIdB64, local: boolean) {
// Get all relay cells
const cellInfos = flatten(
Expand Down Expand Up @@ -188,6 +233,7 @@ export function createProfileStore(client: RelayClient): ProfileStore {
load,
createProfile,
updateProfile,
repairMyConversationProfiles,
};
}

Expand Down
25 changes: 25 additions & 0 deletions ui/src/store/RelayClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,31 @@ export class RelayClient {
});
}

/** Profile writes in progress, per conversation, shared by all callers. */
private profileWrites = new Map<string, Promise<Record>>();

/**
* Make sure a conversation holds your profile, writing it only if a
* local-only lookup finds none. Use this rather than
* `setMyProfileForConversation`: create_profile accepts a second profile for
* the same agent, and joining and the start-up repair can both reach the
* same conversation. Concurrent calls for one conversation share one write,
* and later calls find the written profile locally.
*/
ensureMyProfileForConversation(cell_id: CellId): Promise<Record> {
const key = encodeCellIdToBase64(cell_id);
const pending = this.profileWrites.get(key);
if (pending) return pending;

const write = (async () => {
const existing = await this.getAgentProfile(cell_id, this.client.myPubKey, true);
return existing ?? (await this.setMyProfileForConversation(cell_id));
})().finally(() => this.profileWrites.delete(key));

this.profileWrites.set(key, write);
return write;
}

async setMyProfileForConversation(cell_id: CellId): Promise<Record> {
const record = await this.getAgentProfile(this.provisionedRelayCellId, this.client.myPubKey);
if (!record)
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"welcome_text_2": "Лични, криптирани и защитени с ключове, които само вие контролирате..",
"what_is_your_name": "Как се казвате?",
"you": "Вие",
"unknown_member": "Неизвестен участник",
"update_bar_text": "Volla Messages {{version}} вече е тук. Контактите, които са обновили, вече не могат да получават вашите съобщения — обновете, за да продължите да чатите.",
"update_now": "Обнови",
"updating": "Обновяване…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"welcome_text_2": "Privat, krypteret og sikret med nøgler, som kun du kontrollerer.",
"what_is_your_name": "Hvad hedder du?",
"you": "Du",
"unknown_member": "Ukendt medlem",
"update_bar_text": "Volla Messages {{version}} er her. Kontakter, der har opdateret, kan ikke længere modtage dine beskeder — opdater for at blive ved med at chatte.",
"update_now": "Opdater",
"updating": "Opdaterer…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"welcome_text_2": "Privat, verschlüsselt und gesichert durch Schlüssel, die nur Sie kontrollieren.",
"what_is_your_name": "Wie ist Ihr Name?",
"you": "Du",
"unknown_member": "Unbekanntes Mitglied",
"update_bar_text": "Volla Messages {{version}} ist da. Kontakte, die bereits aktualisiert haben, können deine Nachrichten nicht mehr empfangen — aktualisiere, um weiter zu chatten.",
"update_now": "Aktualisieren",
"updating": "Wird aktualisiert…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"welcome_text_2": "Private, encrypted and secured by keys only you control.",
"what_is_your_name": "What is your name?",
"you": "You",
"unknown_member": "Unknown member",
"update_bar_text": "Volla Messages {{version}} is here. Contacts who have updated can no longer receive your messages — update to keep chatting.",
"update_now": "Update",
"updating": "Updating…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"welcome_text_2": "Privado, encriptado y protegido por claves que sólo usted controla.",
"what_is_your_name": "¿Cuál es su nombre?",
"you": "Usted",
"unknown_member": "Miembro desconocido",
"update_bar_text": "Ya está aquí Volla Messages {{version}}. Los contactos que han actualizado ya no pueden recibir tus mensajes: actualiza para seguir chateando.",
"update_now": "Actualizar",
"updating": "Actualizando…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"welcome_text_2": "Privé, crypté et sécurisé par des clés que vous seul contrôlez.",
"what_is_your_name": "Quel est votre nom?",
"you": "Tu",
"unknown_member": "Membre inconnu",
"update_bar_text": "Volla Messages {{version}} est arrivé. Les contacts qui ont mis à jour ne peuvent plus recevoir vos messages — mettez à jour pour continuer à discuter.",
"update_now": "Mettre à jour",
"updating": "Mise à jour…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"welcome_text_2": "निजी, एन्क्रिप्टेड और केवल आपके नियंत्रण वाली कुंजियों द्वारा सुरक्षित।",
"what_is_your_name": "आपका नाम क्या है?",
"you": "आप",
"unknown_member": "अज्ञात सदस्य",
"update_bar_text": "Volla Messages {{version}} आ गया है। जिन संपर्कों ने अपडेट कर लिया है, वे अब आपके संदेश प्राप्त नहीं कर सकते — चैट जारी रखने के लिए अपडेट करें।",
"update_now": "अपडेट करें",
"updating": "अपडेट हो रहा है…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"welcome_text_2": "Privati, crittografati e protetti da chiavi che solo voi potete controllare.",
"what_is_your_name": "Qual è il suo nome?",
"you": "Tu",
"unknown_member": "Membro sconosciuto",
"update_bar_text": "Volla Messages {{version}} è disponibile. I contatti che hanno aggiornato non possono più ricevere i tuoi messaggi: aggiorna per continuare a chattare.",
"update_now": "Aggiorna",
"updating": "Aggiornamento in corso…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"welcome_text_2": "Privé, versleuteld en beveiligd met sleutels die alleen jij beheert.",
"what_is_your_name": "Wat is je naam?",
"you": "Jij",
"unknown_member": "Onbekend lid",
"update_bar_text": "Volla Messages {{version}} is er. Contacten die al hebben bijgewerkt, kunnen je berichten niet meer ontvangen — werk bij om te blijven chatten.",
"update_now": "Bijwerken",
"updating": "Bijwerken…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"welcome_text_2": "Privat, kryptert og sikret med nøkler som kun du kontrollerer.",
"what_is_your_name": "Hvad heter du?",
"you": "Du",
"unknown_member": "Ukjent medlem",
"update_bar_text": "Volla Messages {{version}} er her. Kontakter som har oppdatert, kan ikke lenger motta meldingene dine — oppdater for å fortsette å chatte.",
"update_now": "Oppdater",
"updating": "Oppdaterer…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"welcome_text_2": "Privat, criptat și securizat prin chei pe care doar tu le controlezi.",
"what_is_your_name": "Care este numele dvs.?",
"you": "Tu",
"unknown_member": "Membru necunoscut",
"update_bar_text": "Volla Messages {{version}} este aici. Contactele care au actualizat nu îți mai pot primi mesajele — actualizează pentru a continua conversațiile.",
"update_now": "Actualizează",
"updating": "Se actualizează…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"welcome_text_2": "Súkromné, zašifrované a zabezpečené kľúčmi, ktoré máte pod kontrolou len vy..",
"what_is_your_name": "Ako sa voláte?",
"you": "Vy",
"unknown_member": "Neznámy člen",
"update_bar_text": "Volla Messages {{version}} je tu. Kontakty, ktoré aktualizovali, už nemôžu prijímať vaše správy — aktualizujte, aby ste mohli ďalej četovať.",
"update_now": "Aktualizovať",
"updating": "Aktualizuje sa…",
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"welcome_text_2": "Privat, krypterat och säkrat med nycklar som bara du kontrollerar.",
"what_is_your_name": "Vad heter du?",
"you": "Du",
"unknown_member": "Okänd medlem",
"update_bar_text": "Volla Messages {{version}} är här. Kontakter som har uppdaterat kan inte längre ta emot dina meddelanden — uppdatera för att fortsätta chatta.",
"update_now": "Uppdatera",
"updating": "Uppdaterar…",
Expand Down
Loading