Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update request handlers and add tests #237

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

kirahsapong
Copy link
Contributor

@kirahsapong kirahsapong commented Apr 9, 2024

closes #236

also added tests and type check

Copy link

changeset-bot bot commented Apr 9, 2024

🦋 Changeset detected

Latest commit: 3d976c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@tbdex/http-server Patch
@tbdex/protocol Patch
@tbdex/http-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 9, 2024

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 3

@tbdex/protocol

  • Project entry file: packages/protocol/src/main.ts

@tbdex/http-client

  • Project entry file: packages/http-client/src/main.ts

@tbdex/http-server

  • Project entry file: packages/http-server/src/main.ts
📄 File: packages/http-server/src/http-server.ts
⚠️ extractor:ae-unresolved-link: The @link reference could not be resolved: The package "@tbdex/http-server" does not have an export "InMemoryOfferingsApi" #L49
⚠️ extractor:ae-unresolved-link: The @link reference could not be resolved: The package "@tbdex/http-server" does not have an export "InMemoryExchangesApi" #L49
⚠️ extractor:ae-unresolved-link: The @link reference could not be resolved: The package "@tbdex/http-server" does not have an export "InMemoryBalancesApi" #L49

TBDocs Report Updated at 2024-04-09T17:08:35Z 3d976c4

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2024

Codecov Report

Merging #237 (3d976c4) into main (5d690ca) will increase coverage by 0.00%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #237   +/-   ##
=======================================
  Coverage   94.77%   94.78%           
=======================================
  Files          42       42           
  Lines        3541     3547    +6     
  Branches      390      392    +2     
=======================================
+ Hits         3356     3362    +6     
  Misses        185      185           
Components Coverage Δ
protocol 94.90% <ø> (ø)
http-client 100.00% <ø> (ø)
http-server 91.13% <100.00%> (+0.05%) ⬆️

@@ -53,5 +54,7 @@ export async function getExchanges(request: Request, response: Response, opts: G
const _result = await callback({ request, response }, queryParams)
}

response.status(200).json({ data: exchanges })
const data: Message[][] = exchanges.map(exchange => exchange.messages)
Copy link
Contributor

Choose a reason for hiding this comment

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

the response body in the spec is an array of id's, whereas this is a 2d array of exchange messages, right? are we not doing that because of other constraints (like because that would require more broad sweeping changes?) https://github.com/TBD54566975/tbdex/tree/main/specs/http-api#response-4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm good thought! the client currently expects Message[][] so best to make a separate PR that updates both client and server according to new spec changes.

can fast follow with that but prob good to at least get this fix up so its at min bug free 🐛

Copy link
Member

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this @kirahsapong!
🚀

@kirahsapong kirahsapong merged commit cf1c881 into main Apr 9, 2024
8 checks passed
@kirahsapong kirahsapong deleted the fix/req-handler-type-mismatch branch April 9, 2024 17:54
@github-actions github-actions bot mentioned this pull request Apr 9, 2024
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.

data mismatch between http-client and server data
5 participants