Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Auto end: a recording started by hand (New note, the agenda) is never stopped by itself once it learns its call app; it asks after 30 s without the mic, as before (a browser's pre-join screen letting go of the mic stopped one)

christianmatdf2a328d49de
diff --git a/app/e2e/autoStop.spec.ts b/app/e2e/autoStop.spec.ts
index 64a01a9d..142f87c8 100644
--- a/app/e2e/autoStop.spec.ts
+++ b/app/e2e/autoStop.spec.ts
@@ -119,7 +119,7 @@ test('a recording started by hand with no call is never stopped by itself', asyn
for (const call of [
{ name: 'Zoom', bundleId: 'us.zoom.CptHost', owner: 'us.zoom.xos' },
{ name: 'FaceTime', bundleId: 'com.apple.avconferenced', owner: 'com.apple.FaceTime' },
-]) test(`an agenda recording binds ${call.name} when it arrives later, then stops when its mic goes away`, async () => {
+]) test(`an agenda recording binds ${call.name} when it arrives later, and is never stopped by itself when its mic goes away`, async () => {
const { app, page, userData } = await launch()
try {
const now = await page.evaluate(() => { const day = new Date(); day.setHours(12, 0, 0, 0); return +day })
@@ -142,14 +142,12 @@ for (const call of [
await signals(app, { micApps: [{ bundleId: call.bundleId, name: 'Audio helper' }], events: [e], runningApps: [call.owner] })
await expect.poll(bound).toBe(call.name)
await signals(app, { micApps: [], events: [e] })
- // the grace is 4 s (CALL_GONE_MS)
- await advance(app, 3000)
+ // started by hand: a browser's pre-join screen letting go of the mic stopped one mid-meeting, so it keeps going
+ await advance(app, 10_000)
await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')
- await advance(app, 1500)
- await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', /^(stopped|done)$/)
const logs = () => readFileSync(join(userData, 'logs/main.log'), 'utf8')
await expect.poll(logs).toContain(`CALL bind meeting=${id} app=${call.name} via=mic`)
- await expect.poll(logs).toContain(`CALL gone meeting=${id} app=${call.name} idle_ms=`)
+ expect(logs()).not.toContain(`CALL gone meeting=${id}`)
} finally { await app.close() }
})
diff --git a/app/src/main/watch.ts b/app/src/main/watch.ts
index b180d444..6150d47f 100644
--- a/app/src/main/watch.ts
+++ b/app/src/main/watch.ts
@@ -34,7 +34,7 @@ export class Watcher {
readonly dismissed = new Set<string>()
private shown: string | null = null // key of the start card, or 'stop'
private busy = false
- private rec: { id: string; lastMic: number; snoozeUntil: number; /** the call app was on the mic during this recording */ seen: boolean; stopped: boolean } | null = null
+ private rec: { id: string; lastMic: number; snoozeUntil: number; /** the call app was on the mic during this recording */ seen: boolean; stopped: boolean; /** started without a call app (New note, the agenda): never stopped by itself */ byHand: boolean } | null = null
/** call apps on the mic at the last look before recording: a recording started from the card belongs to that call */
private idleMic = new Set<string>()
@@ -90,6 +90,8 @@ export class Watcher {
private recording(m: Meeting, s: Signals, now: number) {
const starting = this.rec?.id !== m.id
+ // started by hand (no call app yet: New note, the agenda): never stopped by itself, only asked about
+ const byHand = starting ? !m.app : this.rec!.byHand
const recent = starting && this.idleCall && now - this.idleCall.at <= 6000 ? this.idleCall.app : null
const observed = decide({ ...s, recording: false }, now, new Set())?.app ?? null
if (!m.app && (observed || recent)) {
@@ -97,7 +99,7 @@ export class Watcher {
if (m.app) console.info(`CALL bind meeting=${m.id} app=${m.app} via=${observed ? 'mic' : 'recent-mic'}`)
} else if (starting) console.info(`CALL watch meeting=${m.id} app=${m.app ?? 'none'}`)
if (starting) {
- this.rec = { id: m.id, lastMic: now, snoozeUntil: 0, seen: !!m.app && this.idleMic.has(m.app), stopped: false }
+ this.rec = { id: m.id, lastMic: now, snoozeUntil: 0, seen: !!m.app && this.idleMic.has(m.app), stopped: false, byHand }
this.idleCall = null; this.idleMic.clear()
if (this.shown !== 'stop') this.shown = null
}
@@ -108,7 +110,7 @@ export class Watcher {
// a meeting with no known app has no mic to watch: only the event and silence can end it
const using = !m.app || onMic
if (using) r.lastMic = now
- if (this.d.autoStop && this.d.autoStopOn?.() && callGone({ app: m.app, seen: r.seen, micIdleMs: now - r.lastMic, graceMs: this.d.graceMs })) {
+ if (!r.byHand && this.d.autoStop && this.d.autoStopOn?.() && callGone({ app: m.app, seen: r.seen, micIdleMs: now - r.lastMic, graceMs: this.d.graceMs })) {
console.info(`CALL gone meeting=${m.id} app=${m.app} idle_ms=${now - r.lastMic}`)
r.stopped = true
if (this.shown === 'stop') { this.shown = null; this.d.hide() }
diff --git a/app/test/watch.test.ts b/app/test/watch.test.ts
index db96703c..0b2cb0a4 100644
--- a/app/test/watch.test.ts
+++ b/app/test/watch.test.ts
@@ -243,18 +243,20 @@ describe('stops by itself when the call ends', () => {
describe('binding a call after any recording start', () => {
beforeEach(() => { active = meeting({ app: null }); auto = true; w = autoWatcher() })
- it.each([zoom, { bundleId: 'us.zoom.CptHost', name: 'CptHost' }, { bundleId: 'com.apple.avconferenced', name: 'avconferenced' }])('binds $bundleId ten seconds after an agenda start and stops after the release grace', async (mic) => {
+ // a recording started by hand (New note, Take notes on the agenda) is never stopped by itself: the call app letting go of
+ // the mic while joining (a browser's pre-join screen) stopped one mid-meeting. It asks, as before, after 30 s
+ it.each([zoom, { bundleId: 'us.zoom.CptHost', name: 'CptHost' }, { bundleId: 'com.apple.avconferenced', name: 'avconferenced' }])('binds $bundleId ten seconds after a start by hand, never stops it by itself, and asks after 30 s without the mic', async (mic) => {
const info = vi.spyOn(console, 'info')
const appName = callAppName(callAppId(mic.bundleId)!)!
await w.tick(); clock += 10_000
reading = { micApps: [mic], events: [], runningApps: [callAppId(mic.bundleId)!] }; await w.tick()
expect(active?.app).toBe(appName)
- reading = { micApps: [], events: [] }; clock += 3_999; await w.tick()
+ reading = { micApps: [], events: [] }; clock += 10_000; await w.tick()
expect(log).toEqual([])
- clock++; await w.tick(); await w.tick()
- expect(log).toEqual(['auto:m1'])
- expect(info.mock.calls.map(([line]) => line)).toEqual([
- 'CALL watch meeting=m1 app=none', `CALL bind meeting=m1 app=${appName} via=mic`, `CALL gone meeting=m1 app=${appName} idle_ms=4000`,
+ clock += 20_000; await w.tick()
+ expect(log).toEqual(['stop'])
+ expect(info.mock.calls.map(([line]) => line).filter((l) => !String(l).startsWith('CALL stop-card'))).toEqual([
+ 'CALL watch meeting=m1 app=none', `CALL bind meeting=m1 app=${appName} via=mic`,
])
info.mockRestore()
})
@@ -263,14 +265,15 @@ describe('binding a call after any recording start', () => {
expect(active?.app).toBe('Zoom')
reading = { micApps: [{ bundleId: 'com.microsoft.teams2', name: 'Teams' }], events: [] }
clock += 10_000; await w.tick()
- expect(active?.app).toBe('Zoom'); expect(log).toEqual(['auto:m1'])
+ // started by hand: bound, but never stopped by itself
+ expect(active?.app).toBe('Zoom'); expect(log).toEqual([])
})
it('uses a fresh pre-start observation once, including a dismissed offer', async () => {
active = null; reading = { micApps: [zoom], events: [] }; await w.tick()
w.dismiss('app:us.zoom.xos'); active = meeting({ app: null }); w.cleared()
reading = { micApps: [], events: [] }; clock += 3000; await w.tick()
expect(active?.app).toBe('Zoom')
- clock += 10_000; await w.tick(); expect(log.at(-1)).toBe('auto:m1')
+ clock += 10_000; await w.tick(); expect(log).not.toContain('auto:m1')
})
it('does not bind an unrelated microphone app or an unqualified browser', async () => {
reading = { micApps: [{ bundleId: 'com.apple.VoiceMemos', name: 'Voice Memos' }, { bundleId: 'com.google.Chrome', name: 'Chrome' }], events: [] }