Skip to content

996 feature deduct points when a daily task is cancelled - #1013

Open
EemeliJ wants to merge 2 commits into
devfrom
996-feature-deduct-points-when-a-daily-task-is-cancelled
Open

EemeliJ wants to merge 2 commits into
devfrom
996-feature-deduct-points-when-a-daily-task-is-cancelled

Conversation

@EemeliJ

@EemeliJ EemeliJ commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Brief description

Adds a 10 point (regular) penalty when a player relinquishes an active daily task. The penalty is applied when unreserving, switching to another task, or deleting an owned task. Released tasks return to the pool as fresh tasks, and all cancellation changes run transactionally.

Change list

  • Deduct TASK_CONSTS.POINTS.DAILY_TASK.CANCEL_PENALTY from regular player points.
  • Clamp point deductions atomically at zero.
  • Reset unreserved/switched tasks before returning them to the pool.
  • Apply one penalty when switching from an active task to another.
  • Add a cancellation specific delete flow for owned tasks.
  • Preserve penalty-free task completion behavior.
  • Add coverage for zero boundary, ownership, repeated/concurrent requests, rollback, switching, and deletion.

closes #996

…nts-when-a-daily-task-is-cancelled

# Conflicts:
#	src/__tests__/dailyTasks/formAnInnerConnection.test.ts
@codecov-alt

codecov-alt Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/dailyTasks/dailyTasks.service.ts 96.87% 1 Missing ⚠️
.../rewarder/playerRewarder/playerRewarder.service.ts 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/dailyTasks/dailyTasks.service.ts 87.50% <96.87%> (+12.09%) ⬆️
.../rewarder/playerRewarder/playerRewarder.service.ts 97.14% <83.33%> (-2.86%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

);
if (unreserveErrors) return cancelTransaction(newSession, unreserveErrors);

return endTransaction(newSession, wasUnreserved);

@tickBit tickBit Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, that should this be asynchronous return statement like this:

return await endTransaction(newSession, wasUnreserved);

I noticed, that elsewhere in the code base we have used statements like that.

TASK_CONSTS.POINTS.DAILY_TASK.CANCEL_PENALTY,
session,
);
if (deductionErrors) return cancelTransaction(session, deductionErrors);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar as above.

@tickBit tickBit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would safer to use await in those return statements.

Please include also some output from testing the implementation.

@CapoMK25 CapoMK25 assigned CapoMK25 and unassigned CapoMK25 Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Feature request: Deduct points when a daily task is cancelled

3 participants