lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Move admin flag from person to local_user (fixes #3060)

Open Nutomic opened this issue 2 years ago • 1 comments

The person table is for federated data, but admin flag can only apply to local users. Thats why it really belongs in the local_user table. This will also prevent the federation code from accidentally overwriting the admin flag

Nutomic avatar Jun 29 '23 11:06 Nutomic

This is not a breaking change, the API is unchanged.

Nutomic avatar Jun 30 '23 07:06 Nutomic

Resolved conflicts. For some reason api tests are failing with this error, no idea why:


$ jest -i follow.spec.ts && jest -i src/post.spec.ts && jest -i comment.spec.ts && jest -i private_message.spec.ts && jest -i user.spec.ts && jest -i community.spec.ts
FAIL  src/follow.spec.ts
✕ Follow federated community

● Follow federated community

thrown: "unknown"

10 | } from "./shared";
11 |
> 12 | beforeAll(async () => {
| ^
13 |   await setupLogins();
14 | });
15 |

at Object.<anonymous> (src/follow.spec.ts:12:1)

Nutomic avatar Aug 01 '23 13:08 Nutomic

I'll test it out now

dessalines avatar Aug 02 '23 13:08 dessalines

The admin column on the source table was in the wrong order. It needs to match the order in schema.rs. This was hard to find because they were both boolean columns.

dessalines avatar Aug 02 '23 15:08 dessalines

This test started failing all the sudden.

Here's the failing line

I don't understand why its suddenly unable to resolve a banned person.

dessalines avatar Aug 02 '23 18:08 dessalines