Add test case that exhibits portal does not exist problem.#904
Open
matthughes wants to merge 2 commits intotypelevel:mainfrom
Open
Add test case that exhibits portal does not exist problem.#904matthughes wants to merge 2 commits intotypelevel:mainfrom
matthughes wants to merge 2 commits intotypelevel:mainfrom
Conversation
armanbilge
reviewed
Jun 17, 2023
Comment on lines
+137
to
+143
| pool.use { s => | ||
| s.transaction.use { _ => | ||
| s.prepare(cmd(idx)).flatMap(_.execute((s"name$idx", idx))).map (_ => | ||
| IO.sleep(1.second) >> s.prepare(cmd(idx)).flatMap(_.execute((s"name$idx", idx))).void | ||
| ) | ||
| } | ||
| }.flatten |
Member
There was a problem hiding this comment.
.use(...).flatten looks wrong. It means you are building an IO in the use(...) when the Resource is available, but you are executing it after the use, when the resource has been released.
armanbilge
reviewed
Jun 17, 2023
Comment on lines
+122
to
+128
| pool.use { s => | ||
| s.transaction.use { _ => | ||
| s.prepare(cmd(idx)).flatMap(_.execute((s"name$idx", idx))).map (_ => | ||
| IO.sleep(1.second) >> s.prepare(cmd(idx)).flatMap(_.execute((s"name$idx", idx))).void | ||
| ) | ||
| } | ||
| }.flatMap(identity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In trying to track down the "portal does not exist" problem #553, I was able to create a test case that demonstrates the issue.
My code had a weird construction of .map(effect).flatMap(identity) instead of flatMap(effect). I was able to reliably reproduce the bug in my code with the former and was never able to reproduce with the latter. I was able to replicate this in Skunk code.