Skip to content

Conversation

@mangas
Copy link
Contributor

@mangas mangas commented Sep 30, 2024

BEGIN_COMMIT_OVERRIDE
chore: add dips graphql
END_COMMIT_OVERRIDE

@mangas mangas force-pushed the dips-graphql branch 2 times, most recently from 1c724c9 to ab06867 Compare September 30, 2024 15:20
@coveralls
Copy link

coveralls commented Sep 30, 2024

Pull Request Test Coverage Report for Build 11707736076

Details

  • 304 of 576 (52.78%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.6%) to 72.976%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/src/service.rs 0 25 0.0%
service/src/database/dips.rs 8 64 12.5%
dips/src/lib.rs 227 301 75.42%
service/src/routes/dips.rs 68 185 36.76%
Totals Coverage Status
Change from base Build 11693410651: -1.6%
Covered Lines: 5660
Relevant Lines: 7756

💛 - Coveralls

@mangas mangas force-pushed the dips-graphql branch 3 times, most recently from 2c3a2ec to 4a514e9 Compare October 2, 2024 13:47
@mangas mangas requested review from LNSD and fubhy and removed request for fubhy October 2, 2024 15:31
@mangas mangas marked this pull request as draft October 8, 2024 10:26
@mangas mangas force-pushed the dips-graphql branch 6 times, most recently from 72ebe2c to e2359ab Compare October 8, 2024 11:05
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

Please, check my comments 🙂

@mangas mangas force-pushed the dips-graphql branch 5 times, most recently from 2c49fc1 to bd31868 Compare October 14, 2024 09:31
@mangas mangas marked this pull request as ready for review October 14, 2024 09:32
@mangas mangas marked this pull request as draft October 14, 2024 09:33
@mangas mangas force-pushed the dips-graphql branch 4 times, most recently from 641ad4d to 2fbf0c3 Compare October 14, 2024 10:02
@mangas mangas marked this pull request as ready for review October 14, 2024 11:46
@mangas mangas force-pushed the dips-graphql branch 10 times, most recently from c2c60c6 to af6a0ff Compare November 5, 2024 13:51
@mangas mangas requested a review from LNSD November 5, 2024 14:23
LNSD
LNSD previously approved these changes Nov 6, 2024
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

In general, LGTM ✅

Comment on lines +72 to +73
// should only be usable within a limited period of time.
uint64 timestamp;
Copy link
Contributor

Choose a reason for hiding this comment

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

I have followed the thread, and it is used in the cancellation request validation. What's the goal of this timestamp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

essentially to prevent re-use or any variation of that.

Comment on lines 120 to 125
sqlx::query!(
"UPDATE dips_agreements SET updated_at=now(), cancelled_at=now(), signed_cancellation_payload=$1 WHERE id=$2",
bs,
id,
)
.execute(&self.pool)
.await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would return an error when there's no agreement in the DB with the provided ID. If I am correct, the query will not update anything and will return successfully.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't that the correct outcome anyway? If the query doesn't update anything it's a noop. I don't have a strong preference, if you do I'll change it otherwise I think I'll leave that in for the moment

// data should be the signed voucher, eip712 signed, rlp and base64 encoded.
signed_request: String,
) -> FieldResult<String> {
let store: &Arc<dyn AgreementStore> = ctx.data()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity. Why did you choose dynamic dispatch over a generic argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normally I find it easier to work with dynamic dispatch, generic arguments tend to propagate through the code very easily, I don't think the perf penalty on something like this is worth the trade-off.

@mangas mangas force-pushed the dips-graphql branch 2 times, most recently from 3612be8 to d843fa7 Compare November 6, 2024 16:24
@mangas mangas requested a review from LNSD November 7, 2024 13:36
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@mangas mangas merged commit d10fedb into main Nov 7, 2024
10 checks passed
@mangas mangas deleted the dips-graphql branch November 7, 2024 15:45
@github-actions github-actions bot mentioned this pull request Nov 7, 2024
gusinacio added a commit that referenced this pull request Nov 7, 2024
@gusinacio gusinacio restored the dips-graphql branch November 7, 2024 20:11
@suchapalaver suchapalaver deleted the dips-graphql branch May 8, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants