> For the complete documentation index, see [llms.txt](https://emibergo.gitbook.io/redistrade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emibergo.gitbook.io/redistrade/how-we-provide-reliability.md).

# How we provide reliability

The biggest issue with trade plugins is dupe bugs

We understood this difficulty and I started working on the plugin keeping in mind that\
it should've been designed to have as little as possible ways to produce instabilities

### We adopted 2 measures to counteract dupes:

1. Trade is divided into 3 statuses/phases: <mark style="color:red;">**REFUSED**</mark>**,&#x20;**<mark style="color:green;">**CONFIRMED**</mark>**&#x20;and&#x20;**<mark style="color:blue;">**RETRIEVE**</mark>\
   Those 3 phases lock the player and the trade items to prevent duping by clicking, double-clicking, drag-clicking, and all the things
2. I'm using a plugin to test RedisTrade under stress conditions and on particular cases. The code of **TradeIntegrity** will be open source and released soon, so you can download it and test RedisTrade by yourself

#### RedisTrade is robust, efficiently managing disruptions to the Redis cache connection. It can also withstand server crashes, utilizing a query system to monitor all active trades within the network.

## Our testing suite

<div data-full-width="true"><figure><img src="https://2563736153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDRMhysB3M9xJDpDOwkng%2Fuploads%2FPPikGdl9xyvRbDgVVPzj%2Fezgif-5-240516aede.gif?alt=media&amp;token=1c17d3da-df0a-4bf1-b72f-68da2f476bbc" alt="" width="563"><figcaption><p>My testing suite</p></figcaption></figure></div>

* I start with a **testing modpack** to thoroughly test each GUI feature, identifying any bugs related to item desynchronization
* The second tool is a plugin to make the server lag randomly
* When I test, I choose MySQL and Redis servers with **latency greater than 200ms** to amplify desynchronization issues
* Additionally i attach a debugger to the server instance to check if there is any leftover inside hashmaps and to check if there is any possible memory leak
