JusticeTech System
Відкрити в Telegram
Learn to learn before you teach
Показати більшеКраїна не вказанаКатегорія не вказана
226
Підписники
-124 години
-17 днів
-330 днів
Архів дописів
I know I did a lot with this guy but I don't know how to brag with it
😄😄
This ought to just be a telegram bot but it's not lookin like it
How many developers now a days still practice Algorithm and Flow chart 😃😃
Lazy folks everywhere
+1
‼️ Tech Against Terrorism tested 27 AI models with 2,000+ prompts seeking bomb-making and weapons guidance. ChatGPT refused only 48% of them, the UN-backed group's new report found.
The report documents 30+ cases of AI supporting extremist attacks, linked to 70+ deaths, and flags open-source models as the harder problem because safeguards can be stripped out entirely.
Australia is already moving. The report lands as a 13-year-old faces extremism charges over alleged AI-generated mass shooting scenarios, and Australian researchers are already pushing for turnover-based fines or geoblocks on noncompliant platforms.
Step by step flow
1. Client create an Idempotency key (UUID/ unique string)
2. Client the payment request with the key in header
3. Server check if the key already exits in database
4. If yes return the stored response (no new changes)
5. If yes process the payment, store the results with the key and return the response
What get stored:
Idempotency key
Request details (this can be optional depends on you)
Response (success or failure)
Timestamp (for expiration)
So the whole essence of this Idempotency key is to spot a unique identify and make sure the request is only process once without do too much or Pilling up your code base
Unique for each request
Safe to retry multiple times
Has a validity period (TTL)
Mapped to the original response
What do we further need this Idempotency key
Apis sometimes can be unreliable
Network fails, client retries
User double click
This same request can reach your backend multiple times
The goal is to ensure same action happen only once on the server
So the key act as a fingerprint as request that is when if we've seen it before we don't do it again
So it keeps retrying in the background till become successful Infact you can proceed to had some logic
Let say a client/user send a request with a unique key then Idempotency key is generated all through to the backend
If that same request is sent again with thesame key the backed will end up treating it as a retry and not a new payment 😀
The real solution is in the use of Idempotency key
What it does is that it makes every request not just unique but also safely repeatable
I know many people will say, why don't you just disable the pay button.
Well what this will do is to improve the user experience which is good but won't solve the problem which is a bad practice
Request can still be duplicated because of
1. Network retries
2. Mobile reconnect
3. Browser refresh
4. Client bugs
It means that your backend needs to handle duplicate safely
So what do will do in this case?
