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

Improvement - Imposter responses #178

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

deerbone
Copy link

This PR introduces preloading response body into memory before the mockserver starts. This makes it easier to spot bugs in a configuration that uses a lot of BodyFiles. Any issue with the files is now clearly logged on startup. Watcher still works even with this change.

This change improves the speed of the server since the data doesn't need to get loaded every time a request arrives.

I have also fixed the imposter base path bug, that I later realized is already implemented by #173. I can remove it, but it would be nice to have that fix merged since the main branch is harder to use because of it.

@deerbone deerbone changed the title Improvement/imposter responses Improvement - Imposter responses Oct 15, 2024
@joanlopez joanlopez self-requested a review October 26, 2024 23:32
@joanlopez
Copy link
Member

I have also fixed the imposter base path bug, that I later realized is already implemented by #173. I can remove it, but it would be nice to have that fix merged since the main branch is harder to use because of it.

I'm planning to get that one merged over the next few days, I'll ping you once ready so you can pull those changes.
I just wanted to find some time to add a couple of tests of that change, so we prevent the same mistake once more in the future.

Thanks! 🙏🏻

"time"
)

// ImposterHandler create specific handler for the received imposter
// Handler create specific handler for the received imposter
Copy link
Member

Choose a reason for hiding this comment

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

Is this a mistake/typo? 🤔

Copy link
Member

@joanlopez joanlopez left a comment

Choose a reason for hiding this comment

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

Thanks so much for this @deerbone, this is also a nice idea. However, my feeling is that it might have conflicts with #177. For instance, I guess that applyTemplate will need to be part of the writeBody function.

So, let's try to get the other one merged, so later we can more easily see if there's any conflict with this changeset and do a final review.

🙌🏻 🙇🏻

@deerbone
Copy link
Author

my feeling is that it might have conflicts with #177

@joanlopez for sure, there will be conflicts but nothing major that I can't resolve. I'll revisit this PR once the other one is merged.

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.

2 participants