Skip to content

Conversation

k4n4ry
Copy link
Contributor

@k4n4ry k4n4ry commented Jan 15, 2023

close #171

  • Inspector structs which added Alias() are follows:
    • Array
    • Boolean
    • Cookie
    • DateTime
    • Duration
    • Match
    • Number
    • Object
    • Response
    • String
    • Value
    • WebSocketMessage
    • WebSocket

@coveralls
Copy link
Collaborator

coveralls commented Jan 15, 2023

Coverage Status

Coverage: 95.765% (+0.04%) from 95.726% when pulling 534ab72 on k4n4ry:feature/impl-alias-support into e3fb65a on gavv:master.

@gavv gavv added the ready for review Pull request can be reviewed label Jan 18, 2023
@gavv
Copy link
Owner

gavv commented Jan 18, 2023

Thanks for PR! Will review in upcoming days.

Copy link
Owner

@gavv gavv 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 PR!

@gavv gavv added needs revision Pull request should be revised by its author and removed ready for review Pull request can be reviewed labels Jan 22, 2023
@github-actions
Copy link

☔ The latest upstream change (presumably these) made this pull request unmergeable. Please resolve the merge conflicts.

@github-actions github-actions bot added the needs rebase Pull request has conflicts and should be rebased label Jan 24, 2023
@gavv
Copy link
Owner

gavv commented Jan 24, 2023

Hi, please rebase your PR on fresh master. It has reworked chain interface.

Instead of:

	r.chain.enter("XXX()")
	defer r.leave()

	if r.failed() {
		return r
	}

we should now use:

	opChain := r.chain.enter("Decode()")
	defer opChain.leave()

	if opChain.failed() {
		return r
	}

In other words, chain.enter() now returns a new chain instance, and we should use it for all other operations with chain. This change is part of making this lib thread-safe.

Related commits:

@gavv
Copy link
Owner

gavv commented Jan 24, 2023

The following changes in chain affect this PR:

  • enter does not modify the chain now; instead it creates a clone, modifies this clone, and returns it
  • leave does not modify the chain now; since enter returns a clone, we can just drop this clone
  • fail is allowed only between enter/leave
  • it's not allowed to call enter two times in a row; after first enter you should make a clone, and you can call enter again only on that clone
  • replace also returns a clone, just like enter

@gavv
Copy link
Owner

gavv commented Jan 24, 2023

Sorry for creating conflicts. I was waiting with my changes for a while, in hope that I'll find a time window when there are no active PRs and I can merge them without creating conflicts. However it seems that currently new PRs are coming too often and there is no such window :)

@k4n4ry k4n4ry force-pushed the feature/impl-alias-support branch from a8d352a to b9b52d4 Compare January 26, 2023 07:20
@k4n4ry k4n4ry force-pushed the feature/impl-alias-support branch from b9b52d4 to 534ab72 Compare January 26, 2023 07:34
@k4n4ry
Copy link
Contributor Author

k4n4ry commented Jan 26, 2023

@gavv I rebased and fixed, so please check when you have time. Thank you.

@gavv gavv merged commit 34ba607 into gavv:master Jan 26, 2023
@gavv
Copy link
Owner

gavv commented Jan 26, 2023

Thank you! Solid work!

@gavv
Copy link
Owner

gavv commented Jan 26, 2023

Two small follow-up commits:

@gavv gavv removed needs revision Pull request should be revised by its author needs rebase Pull request has conflicts and should be rebased labels Jan 26, 2023
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.

Add support for aliases
3 participants