Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

concurrent-write-interleaving

/concurrent-write-interleaving

Wysyła dwa zapisy do tego samego rekordu naraz i sprawdza wynik, bo bez zabezpieczenia późniejszy zapis może nadpisać wcześniejszy.

Repozytorium
flawpath ↗
Licencja
MIT
Ostatnia zmiana repozytorium
28.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 28.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wysyła dwa zapisy do tego samego rekordu naraz i sprawdza wynik, bo bez zabezpieczenia późniejszy zapis może nadpisać wcześniejszy.

Oryginalny opis (EN)

Issue two writes to the same record together and read the result, because an unguarded update lets the later write silently discard the earlier one. Use when the API permits concurrent updates to one record and the interleaving behaviour is unconfirmed

Jak działa

  1. Procedure
  2. Signals
  3. Patterns
  4. Pitfalls
  5. Done when
  6. References
Sekcje z nagłówków SKILL.md, w oryginale · 61 linii, 375 słów
Podgląd SKILL.md
---
name: concurrent-write-interleaving
description: "Issue two writes to the same record together and read the result, because an unguarded update lets the later write silently discard the earlier one. Use when the API permits concurrent updates to one record and the interleaving behaviour is unconfirmed"
pack: flawpath
version: 1.0.0
category: backend-api
tags: [probe, concurrency, state]
---

# Concurrent Write Interleaving

> Issue two writes to the same record together and read the result, because an unguarded update lets the later write silently discard the earlier one

**Use when:** the API permits concurrent updates to one record and the interleaving behaviour is unconfirmed

**Avoid when:** an optimistic locking or version field is enforced and a test confirms a conflict is rejected

## Procedure

1. Confirm the boundary permits concurrent requests and that a rollback exists for the record.
2. Capture the record's state, then send two updates touching different fields at the same time.
3. Read the record back and record whether both changes survived or one was lost.
4. Repeat if the first attempt happened to serialize by timing, since a clean result may just be luck.
5. Check for a version, etag or updated-at guard in the request and response.
6. Record the observed behaviour as guarded, lost update, or serialized by timing with evidence.

## Signals

- Two updates to different fields result in only one surviving
- No version or etag guard appears in the request or response contract
- The record's updated-at is identical after two logically separate writes
- A repeat of the test yields a different outcome, indicating timing dependence

## Patterns

**1. Interleaving record**

```text
write A {field1} and write B {field2} sent together -> read-back: field1 unchanged, field2 applied; verdict: lost update
```

**2. Guard check**

```text
look for version, etag or updated-at in both directions; absence is recorded as no guard rather than as safe by default
```

**3. Repeat rule**

```text
a single clean run may be serialization by luck; repeat enough times to state the behaviour honestly
```

## Pitfalls

- Concluding safe behaviour from one run that happened to serialize
- Changing two fields in one request rather than issuing two requests
- Reporting a lost update without noting whether a guard field exists but was not supplied

## Done when

- Two concurrent writes have a recorded read-back showing which changes survived
- The presence or absence of a version guard is stated, with repeats to rule out luck

## References

- [CWE-362 - Concurrent execution using shared resource with improper synchronization](https://cwe.mitre.org/data/definitions/362.html)
- [OWASP - Race condition guidance](https://owasp.org/www-project-web-security-testing-guide/)

Wersje

W bazie nie ma innych skilli o nazwie concurrent-write-interleaving.

Migawka bazy z 13.11.2026 · wersja paczki fdf3212d563e (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100handle-optimistic-concurrency
    Włącza i obsługuje optymistyczną kontrolę współbieżności ABP: IHasConcurrencyStamp, stempel w DTO i obsługę AbpDbConcurrencyException przy równoległych aktualizacjach tego samego rekordu.
  • 90testing-concurrent-behavior
    Prowadzi testowanie zachowania współbieżnego w pracy nad jakością tak, by wynik był śledzalny, niezależnie weryfikowalny i bezpieczny do przekazania innemu agentowi.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.