Skip to content

Refactor fields_base#149

Merged
ashtum merged 7 commits into
cppalliance:developfrom
ashtum:refactor-fields-base
Jul 24, 2025
Merged

Refactor fields_base#149
ashtum merged 7 commits into
cppalliance:developfrom
ashtum:refactor-fields-base

Conversation

@ashtum
Copy link
Copy Markdown
Collaborator

@ashtum ashtum commented Jul 23, 2025

No description provided.

@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 90cacc5 to 155484b Compare July 23, 2025 15:40
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 155484b to 2bf9980 Compare July 23, 2025 15:59
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 2bf9980 to e6867ca Compare July 23, 2025 16:11
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 96.65428% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.82%. Comparing base (7b48277) to head (17f5bb3).
Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
src/rfc/transfer_coding_rule.cpp 88.33% 7 Missing ⚠️
src/detail/header.cpp 97.95% 1 Missing ⚠️
src/field.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #149      +/-   ##
===========================================
+ Coverage    91.56%   91.82%   +0.26%     
===========================================
  Files           76       76              
  Lines         5001     5005       +4     
===========================================
+ Hits          4579     4596      +17     
+ Misses         422      409      -13     
Files with missing lines Coverage Δ
include/boost/http_proto/detail/header.hpp 100.00% <ø> (ø)
include/boost/http_proto/fields.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/fields_base.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/fields_view_base.hpp 100.00% <ø> (ø)
include/boost/http_proto/metadata.hpp 100.00% <ø> (ø)
include/boost/http_proto/request.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/response.hpp 100.00% <100.00%> (ø)
src/fields_base.cpp 94.87% <100.00%> (+1.26%) ⬆️
src/fields_view_base.cpp 96.20% <100.00%> (+0.31%) ⬆️
src/parser.cpp 87.61% <100.00%> (ø)
... and 5 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b48277...17f5bb3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

BOOST_ASSERT(id != field::unknown);
// Precondition violation
if(id == field::unknown)
detail::throw_logic_error();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why are we changing this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

we store unknown fields using the id field::unknown. calling erase(id) or set(id, value) with id == field::unknown would affect all these fields, which is not what users expect.
I made it an exception because it's a precondition violation that's likely to occur in user code.
for example, this can happen when generating a response based on the field id of a received request. if the field is not well-known the parser assigns it the field::unknown id.

@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 98b4527 to 3ad3377 Compare July 24, 2025 06:43
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

1 similar comment
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 2b7a82a to caa0963 Compare July 24, 2025 11:23
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from caa0963 to 0773ca1 Compare July 24, 2025 17:58
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 0773ca1 to 169c7c2 Compare July 24, 2025 18:28
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 169c7c2 to 2e53b76 Compare July 24, 2025 18:59
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum force-pushed the refactor-fields-base branch from 2e53b76 to 17f5bb3 Compare July 24, 2025 19:16
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://149.http-proto.prtest.cppalliance.org/index.html

@ashtum ashtum merged commit f742d7c into cppalliance:develop Jul 24, 2025
60 of 61 checks passed
@ashtum ashtum deleted the refactor-fields-base branch October 4, 2025 05:40
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