nxtgauge-backend-rust/crates
Ashwin Kumar Sivakumar 617a75971f fix(companies): contact-unlock double-spend and job-quota race
view_contact previously decremented free_contact_views/
purchased_contact_views on every call with no record of which
applications had already had their contact unlocked -- refreshing the
same application's contact panel silently re-spent the allowance every
time, not just under concurrency, and the check-then-act shape also let
concurrent requests both pass the exhausted-quota check before either
UPDATE committed. Now the whole claim (dedup check + conditional
decrement + job_applications.contact_unlocked_at write) runs in one
transaction with company_profiles locked FOR UPDATE, gated on a
WHERE ... > 0 guard on the decrement itself.

create_job had the same shape for the 1-free-job/month rule and
purchased_job_slots: two concurrent requests could both observe
"quota available" before either committed, letting a company publish
2+ free jobs in a month or drive purchased_job_slots negative. Same
fix: lock company_profiles FOR UPDATE for the whole check+mutate+
insert sequence.

Also adds CHECK (>= 0) constraints on all four company_profiles
counters as defense-in-depth, matching the pattern tracecoin_wallets
already uses for balance/reserved.
2026-08-18 00:51:02 +05:30
..
auth fix payments runtime and jwt backend 2026-06-09 22:52:30 +02:00
cache Fix security audit findings: admin authz, captcha, secret leak, CORS 2026-07-23 17:31:48 +05:30
contracts fix: security, wallet holds, printpdf upgrade 2026-08-12 13:38:17 +02:00
db fix(companies): contact-unlock double-spend and job-quota race 2026-08-18 00:51:02 +05:30
db-migrate feat(db): update service handlers and models for new schema 2026-04-13 00:29:44 +02:00
email Update backend services: catering_services, companies, developers, gateway, job_seekers, photographers, social_media_managers, tutors, ugc_content_creators, users; update cache (otp, token), contracts (profession_shared, profession_state), db (job_seeker, verification), email; add revision-requested email template; update init-db.sql and start-services.sh 2026-05-08 15:34:29 +02:00
invoice feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase 2026-07-21 03:02:47 +05:30
storage Add presigned document URLs to stop leaking permanent Backblaze links 2026-07-27 18:07:15 +05:30
wallet feat: profile photo upload, PDF resume generation, AI auto-apply, schema fixes 2026-07-02 13:31:06 +02:00