Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/big-carrots-design.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tame-times-warn.md

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @exactly/mobile

## 1.0.45

### Patch Changes

- [#617](https://github.com/exactly/exa/pull/617) [`b3153b8`](https://github.com/exactly/exa/commit/b3153b8ae245cc70a31b9c6ebcc9e60423e0245a) Thanks [@itofarina](https://github.com/itofarina)! - 🐛 include installments fee in payment details

Choose a reason for hiding this comment

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

critical

There appears to be a potential bug in the implementation of the feature described in this changelog entry.

In src/components/activity/details/PaymentDetails.tsx, the calculation for the per-installment amount for multi-installment plans (item.mode > 1) seems inconsistent with the calculation for the total amount.

  • The per-installment amount (lines 72-76) is derived from item.usdAmount + (item as InstallmentsActivity).borrow.fee.
  • The total amount (lines 91-99) is calculated using (item as InstallmentsActivity).borrow.installments.reduce((accumulator, installment) => accumulator + installment.fee, item.usdAmount).

The reduce method for the total amount is likely the correct source of truth for the sum of all fees. However, the per-installment calculation uses item.borrow.fee, which may not be the correct total fee. This can lead to displaying an incorrect amount for each installment.

This is a critical issue as it involves displaying incorrect financial data to the user.

To ensure consistency and correctness, the per-installment amount should be calculated based on the same total amount logic. Here is a suggested refactor:

// In PaymentDetails.tsx, for the item.mode > 1 case:

// Use the same logic as the total amount calculation to get the total fee.
const totalFee = (item as InstallmentsActivity).borrow.installments.reduce(
  (accumulator, installment) => accumulator + installment.fee,
  0,
);

// Then, in the JSX for per-installment amount:
{item.mode > 1 &&
  ((item.usdAmount + totalFee) / (item as InstallmentsActivity).borrow.installments.length).toFixed(2)}

// The total amount calculation is already correct.


- Updated dependencies [[`bfd960c`](https://github.com/exactly/exa/commit/bfd960ce67ea03c30301b451aef2a6d1f53807fa)]:
- @exactly/server@0.2.47

## 1.0.44

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exactly/mobile",
"version": "1.0.44",
"version": "1.0.45",
"title": "Exa App",
"shortDescription": "What finance should be today",
"description": "A Card. A Wallet. A DeFi Protocol. All of it together.",
Expand Down Expand Up @@ -38,7 +38,7 @@
"@alchemy/aa-core": "^3.19.0",
"@exactly/common": "workspace:^0.0.10",
"@exactly/lib": "^0.1.0",
"@exactly/server": "workspace:^0.2.45",
"@exactly/server": "workspace:^0.2.47",
"@expo/metro-runtime": "~4.0.1",
"@farcaster/frame-sdk": "^0.1.12",
"@farcaster/miniapp-sdk": "^0.2.1",
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @exactly/server

## 0.2.47

### Patch Changes

- [#612](https://github.com/exactly/exa/pull/612) [`bfd960c`](https://github.com/exactly/exa/commit/bfd960ce67ea03c30301b451aef2a6d1f53807fa) Thanks [@aguxez](https://github.com/aguxez)! - ✨ support pax assistance

## 0.2.46

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exactly/server",
"version": "0.2.46",
"version": "0.2.47",
"private": true,
"scripts": {
"build": "pkgroll --sourcemap --src . && sentry-cli sourcemaps inject -o exactly -p server dist",
Expand Down
Loading