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

proto: make InternalMessageInfo functional #1129

Merged
merged 1 commit into from May 14, 2020
Merged

proto: make InternalMessageInfo functional #1129

merged 1 commit into from May 14, 2020

Conversation

dsnet
Copy link
Member

@dsnet dsnet commented May 14, 2020

The InternalMessageInfo type only exists to implement the
XXX methods on generated messages where those methods were
only ever intended to be called by this module itself.

Since v1.4.0, this module no longer relies on the XXX methods,
so the InternalMessageInfo and its implementation is supposed
to be dead code. Unfortunately, there are external usages that
violate our compatibility agreement and either directly call
the XXX methods or indirectly call it because some library
type-asserts to the existence of these methods.

This change adds minimal support for InternalMessageInfo by
just calling out directly to the v2 implementation.

func (*InternalMessageInfo) Merge(Message, Message) { panic("not implemented") }
func (*InternalMessageInfo) Size(Message) int { panic("not implemented") }
func (*InternalMessageInfo) Unmarshal(Message, []byte) error { panic("not implemented") }
// Deprecated: Do not use.

Choose a reason for hiding this comment

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

I suggest adding more detailed info about the deprecation. Include such as:

  • why this would be deprecated?
  • when this would be removed from codebase?
  • how to migrate if the user happens using this?

Choose a reason for hiding this comment

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

Same as below.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer not. I can mention that it's an internal type, but users really should not be looking at these.

Copy link
Contributor

@neild neild left a comment

Choose a reason for hiding this comment

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

Unfortunate.

The InternalMessageInfo type only exists to implement the
XXX methods on generated messages where those methods were
only ever intended to be called by this module itself.

Since v1.4.0, this module no longer relies on the XXX methods,
so the InternalMessageInfo and its implementation is supposed
to be dead code. Unfortunately, there are external usages that
violate our compatibility agreement and either directly call
the XXX methods or indirectly call it because some library
type-asserts to the existence of these methods.

This change adds minimal support for InternalMessageInfo by
just calling out directly to the v2 implementation.
@dsnet dsnet merged commit 07c14f1 into master May 14, 2020
@dsnet dsnet deleted the compat branch May 14, 2020 19:59
This was referenced Mar 16, 2021
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.

None yet

3 participants