Operator.increment via updateRow returns 500 on tables with a point column (1.9.5)
- Dominant language
- TypeScript
- Stars
- 57.4k
- Forks
- 5.7k
- Avg merge
- 16h 27m
- Merged PRs (30d)
- 291
Description
### 👟 Reproduction steps
Minimal A/B (same project, same integer column, only difference is a `point` column):
1. Create table A with only an integer column `count` (not required, default `0`).
2. Create table B with integer column `count` **and** a required `point` column `location`.
3. Insert a row in each table with `count: 10` (table B also gets a valid point, e.g. `[-122.0, 37.0]`).
4. On each row, call:
```http
PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
Content-Type: application/json
{
"data": {
"count": "{\"method\":\"increment\",\"values\":[1]}"
}
}
```
SDK equivalent:
```dart
await tablesDB.updateRow(
databaseId: databaseId,
tableId: tableId,
rowId: rowId,
data: {
'count': Operator.increment(),
},
);
```
Observed:
- Table A (no point): **succeeds**
- Table B (with point): **fails** with `500 general_unknown`
5. On the failing table B row, the dedicated increment route still works:
```http
PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/count/increment
{ "value": 1 }
```
### 👍 Expected behavior
`updateRow` with `Operator.increment()` should atomically increment the integer column on any table, including tables that also have a `point` column — same as `incrementRowColumn` / the `/increment` route.
### 👎 Actual Behavior
On tables that include a `point` column:
```json
{
"message": "Server Error",
"code": 500,
"type": "general_unknown",
"version": "1.9.5"
}
```
- No useful error body.
- Explicit assignment (e.g. `"count": 11`) on the same row works.
- `incrementRowColumn` / `/increment` on the same row works.
- Also fails when staged inside a multi-table transaction (commit returns the same 500).
On an otherwise identical table without a `point` column, the same `Operator.increment()` via `updateRow` works.
### 🎲 Appwrite version
Different version (specify in environment)
### 💻 Operating system
Linux
### 🧱 Your Environment
- Appwrite **1.9.5**
- Reproduced with the Dart server SDK and with raw HTTP
- Confirmed with a minimal A/B: integer-only table vs integer + required `point` column
- Workaround: use `TablesDB.incrementRowColumn(...)` (supports `transactionId`) instead of `Operator.increment()` in `updateRow` when the table has a `point` column
### 👀 Have you spent some time to check if this issue has been raised before?
- [x] I checked and didn't find similar issue
### 🏢 Have you read the Code of Conduct?
- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
Start by reproducing the A/B table comparison through updateRow with Operator.increment(), then trace its operator handling and compare it with incrementRowColumn and the /increment route. Check the transaction path as well; done means updateRow increments successfully on tables with a point column, including staged transactions, without the 500 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, typescript
- Domain
- backend-api-design, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100