- Timestamp:
- 07/30/2026 09:32:40 AM (6 weeks ago)
- Branches:
- main
- Children:
- 67f7150
- Parents:
- d3a1abd
- File:
-
- 1 edited
-
test/c2s-compose.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/c2s-compose.test.js
rd3a1abd ra9da2c0 117 117 }); 118 118 119 test('the OUTBOX serves the attachment too, not only the delivered Create', async () => { 120 // Root of the broken iPhone player (Robins schermafdrukken, 30-7): the 121 // outbox SELECT did not include c2s_attachments, so a note pulled via the 122 // outbox (backfill, boiert.eu) had NO Video attachment and readers fell 123 // back to the content tag with its relative, dead src. The delivered copy 124 // was fine, which is why one device worked and the other did not. This 125 // locks the outbox contract: the same narrow SELECT, through buildNote, 126 // must carry the attachment. 127 const r = await AP.ingestOutboxActivity(site, user, { 128 type: 'Create', 129 object: { 130 type: 'Note', content: '<p>buiten</p>', 131 to: ['https://test.example/ap/users/kid/followers'], 132 cc: ['https://www.w3.org/ns/activitystreams#Public'], 133 attachment: [{ type: 'Video', url: '/media/reply-media/buiten.mp4', mediaType: 'video/mp4' }], 134 }, 135 }); 136 const row = db.prepare( 137 `SELECT id, slug, title, content, cover_image_url, cover_video_url, nsfw, content_warning, c2s_attachments, published_at, created_at 138 FROM posts WHERE id = ?`).get(r.id); 139 const note = AP.buildNote('https://test.example', site, row); 140 const vid = (note.attachment || []).find((a) => a.url.endsWith('buiten.mp4')); 141 assert.ok(vid, 'the outbox-shaped row still yields the Video attachment'); 142 assert.equal(vid.type, 'Video'); 143 assert.ok(!/<video\b/i.test(note.content), 'and the content stays clean'); 144 }); 145 119 146 test('a media-only post is a post, not an empty-note error', async () => { 120 147 const r = await AP.ingestOutboxActivity(site, user, {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)