## TL;DR

For "InternalServerError: could not resolve trailing pointer class for (__derived__::__old__)": what was reported: Issue geldata/gel#5883 (closed, 12 comments): - EdgeDB Version: 4.0-dev.7696+eae6d5a - EdgeDB CLI Version: 3.5.0-dev.1025+fec3413 - OS Version: Linux hp 6.1.39-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 19 Jul 2023 17:58:31 +0000 x86_64 GNU/Linux Steps to Reproduce: 1. insert Foo { name := "f1" }; 2. update Foo set { name := "f1" }; `` InternalServerError: could not resolve trailing pointer class for (\_\_derived\_\_::\_\_old\_\_) Hint: This is most likely a bug in EdgeDB.

```text
InternalServerError: could not resolve trailing pointer class for (__derived__::__old__)
Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
```

## Steps

1. What was reported:
Issue geldata/gel#5883 (closed, 12 comments): - EdgeDB Version: 4.0-dev.7696+eae6d5a
- EdgeDB CLI Version: 3.5.0-dev.1025+fec3413
- OS Version: Linux hp 6.1.39-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 19 Jul 2023 17:58:31 +0000 x86_64 GNU/Linux

2. `insert Foo { name := "f1" };`
2. `update Foo set { name := "f1" };`

```
InternalServerError: could not resolve trailing pointer class for (__derived__::__old__)
Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
```

3. ```
abstract type Revisable {
 ...

4. What works:
Comparing objects with `=` only compares ids, so to bump a revision only when properties actually changed, compare the unpacked JSON property sets:

5. rewrite update using (
 (__old__.rev + 1)
 if exists ((select json_object_unpack([json]__subject__{*})
 except json_object_unpack([json]__old__{*})))
 else __old__.rev
);

6. The maintainer confirmed this works for detecting property changes. Caveat from the thread: this is a workaround, not the idiomatic way. A proper structural comparison (something like `std::eq_properties()`) does not exist yet; it is tracked separately as issue #5335.

Expected: What works: Comparing objects with = only compares ids, so to bump a revision only when properties actually changed, compare the unpacked JSON property sets: rewrite update using ( (\_\_old\_\_.rev + 1) if exists ((select json\_object\_unpack([json]\_\_subject\_\_{}) except json\_object\_unpack([json]\_\_old\_\_{}))) else \_\_old\_\_.rev ); The maintainer confirmed this works for detecting property changes.

## When to use

You are seeing this: Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug\_report.md ` Schema: ` abstract type Revisable {... Use this skill when you run into "Rewrite in abstract types possible?".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 4.0-dev.7696, 3.5.0-dev.1025, hp 6.1.39-1. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Edge cases

- Caveat from the thread: this is a workaround, not the idiomatic way.

## Sources

- https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
