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
20 changes: 12 additions & 8 deletions playwright/support/fixtures/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ export class Node {
}

async move(newName: string) {
await this.page.request.fetch(
`/remote.php/webdav/${this.name}`,
{
headers: {
Destination: `/remote.php/webdav/${newName}`,
},
method: 'MOVE',
})
// retry while the file is locked, e.g. by preview generation after saving
await expect(async () => {
const response = await this.page.request.fetch(
`/remote.php/webdav/${this.name}`,
{
headers: {
Destination: `/remote.php/webdav/${newName}`,
},
method: 'MOVE',
})
expect(response.status()).toBe(201)
}).toPass({ timeout: 10_000 })
return new Node({ ...this, page: this.page, name: newName })
}

Expand Down
3 changes: 3 additions & 0 deletions src/extensions/CollaborationCaret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function render(user: AwarenessUser, clientId?: number): HTMLElement {

cursor.classList.add('collaboration-carets__caret')
cursor.setAttribute('style', `border-color: ${user.color}`)
// The caret sits inside the document text. Hide it from screen readers
// so they don't read the user name in the middle of the text.
cursor.setAttribute('aria-hidden', 'true')

const label = document.createElement('div')
label.id = `collaboration-carets__label__${clientId}`
Expand Down
8 changes: 6 additions & 2 deletions src/services/SaveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ class SaveService {
if (!this.pendingAutosave) {
const wait = nextSaveAttempt - now
logger.debug(
`Just saved, will try again in ${Math.ceil(wait)} seconds.`,
`Just saved, will try again in ${Math.ceil(wait / 1000)} seconds.`,
)
this.pendingAutosave = window.setTimeout(this.autosave, wait)
this.pendingAutosave = window.setTimeout(() => {
// Reset so a failing save can schedule the next attempt
this.pendingAutosave = 0
this.autosave()
}, wait)
}
return
}
Expand Down
Loading