1.5.0: Autosave triggers repeated 409 conflict errors on non-English monolingual sites
## Problem/Motivation
After updating to Canvas 1.5.0, editing any Canvas page or content template throws a 409 conflict error after a short time. The error appears consistently on every editing session and is triggered automatically by the autosave feature, not by manual save attempts.
The error disappears temporarily after clearing the Canvas autosave keys from the `key_value` table, but reappears as soon as autosave runs again, making the editor unusable for sustained editing sessions.
The site is monolingual with Spanish (`es`) as the only language. The footer page region appears in the autosave conflict data with `langcode: en`, suggesting Canvas 1.5.0 is incorrectly assigning English as the langcode for page regions on non-English sites.
## Environment
- **Canvas version:** 1.5.0
- **Drupal core version:** 11.3.11
- **PHP version:** 8.4.20
- **Database:** 11.8.6-MariaDB
- **Multilingual:** No — monolingual site, single language Spanish (`es`)
- **Previous Canvas version:** 1.4.1
## Steps to Reproduce
1. Install Canvas 1.5.0 on a monolingual Drupal site with a non-English default language
2. Open any Canvas page or content template in the editor
3. Wait for the autosave interval to trigger (approximately 30–60 seconds)
4. Observe the 409 conflict error appearing in the editor UI
## Actual Result
The editor displays:
Drupal Canvas has encountered an unexpected error. Error 409: \[object Object\]
The browser console shows:
```json
{
"errors": [
{
"detail": "Conflict detected.",
"source": {
"pointer": "canvas_page:20:es"
},
"code": 4,
"meta": {
"entity_type": "canvas_page",
"entity_id": "20",
"label": "Inicio",
"conflict_id": "609",
"api_auto_save_key": "canvas_page:20:es"
}
}
],
"data": {
"canvas_page:20:es": {
"owner": {
"name": "admin",
"avatar": null,
"uri": "\/user\/1",
"id": 1
},
"entity_type": "canvas_page",
"entity_id": "20",
"langcode": "es",
"label": "Inicio",
"data_hash": "7e31f63ef10b3e08",
"updated": 1780521486
},
"page_region:havensch_theme.footer": {
"owner": {
"name": "admin",
"avatar": null,
"uri": "\/user\/1",
"id": 1
},
"entity_type": "page_region",
"entity_id": "havensch_theme.footer",
"langcode": "en",
"label": "Pie de página region",
"data_hash": "2f1be982b62c65a8",
"updated": 1780521486
}
}
}
```
## Expected Result
The editor should save without conflict errors when only one user is editing the page. No actual concurrent editing conflict exists — there is only one user (admin) active.
## Temporary Workaround
Deleting all Canvas-related records from the `key_value` table temporarily resolves the issue:
```sql
DELETE FROM key_value WHERE collection LIKE '%canvas%';
```
However the error returns on the next autosave cycle.
## Additional Notes
- The error only started after updating from Canvas 1.4.1 to 1.5.0
- The [1.5.0 release notes](https://www.drupal.org/project/canvas/releases/1.5.0) mention _"strengthened autosave conflict detection"_ — this change appears to be the source of the regression
- The issue affects **every** Canvas page and content template, not just specific nodes
- Only one user (admin) is editing — there is no actual concurrent editing conflict
- The `page_region` autosave key shows `langcode: en` despite the site being configured entirely in Spanish (`es`). This suggests Canvas 1.5.0 is hardcoding `en` as the langcode for page regions instead of using the site's configured default language, which immediately triggers a false conflict with page entities that correctly use `es`
- This likely affects any Canvas site whose default language is not English
- Language detection has been disabled from the beginning at `/admin/config/regional/language/detection`. The site has always operated with a fixed Spanish (`es`) language and no URL-based or browser-based language negotiation. This rules out any language switching or detection mechanism as a contributing factor, and reinforces that the `langcode: en` appearing in the `page_region` autosave key is being hardcoded by Canvas 1.5.0 itself rather than being influenced by any language negotiation setting.
issue