Mocker icon indicating copy to clipboard operation
Mocker copied to clipboard

Feature request: ignoring domains/subdomains or URL prefix

Open rogerluan opened this issue 4 years ago • 11 comments

Hey 👋

I constantly see Mocker warnings about not mocking 3rd party URLs such as from mixpanel or Realm. The problem is that the URLs look like:

https://api.mixpanel.com/track/?data=eyJldmVudCI………redacted-for-brevity-but-it's-a-really-long-url-jBkYmQ3ODzeCJ9fQ==&ip=1
https://static.realm.io/update/cocoa?x.y.z // where x.y.z is my Realm library version

Thus I thought if I called:

Mocker.ignore(URL(string: "https://static.realm.io")!)

That Mocker would ignore all requests within this domain, but it doesn't.

I'd like to be able to ignore calls to realm.io or mixpanel.com (perhaps even omitting static. or api. for instance), or at least https://static.realm.io and https://api.mixpanel.com.

I'm aware of a function to ignore all URLs but really doesn't accomplish the goal because I like the warnings for all requests that are from my own application.

What are the challenges around implementing this? Are there any risks?

Appreciate all the help!

rogerluan avatar Apr 15 '21 07:04 rogerluan

Bump

rogerluan avatar May 16 '21 03:05 rogerluan

Ugh.. I commented and the bot still closed my issue anyway 😥 @AvdLee could you reopen this issue? And perhaps label is somehow that it doesn't get auto-closed? 🙇 🙏

rogerluan avatar May 27 '21 01:05 rogerluan

@rogerluan this sounds like a valuable feature! We don't have the time to work on these requests, unless we need them ourselves. We do allow contributions and we're often fast in reviewing those.

If you can find the time to implement this, feel free to do so and I'm happy to review it right after!

AvdLee avatar May 27 '21 08:05 AvdLee

Thanks for the response @AvdLee ! If I can find the time I'll open a PR with a proposal 🤗

rogerluan avatar May 27 '21 12:05 rogerluan

Oh no, it's the stale bot again 😕

rogerluan avatar Jun 27 '21 00:06 rogerluan

Can the bot be selectively disabled for specific PRs? Say, by adding a special label? :)

rogerluan avatar Aug 30 '21 02:08 rogerluan

Can the bot be selectively disabled for specific PRs? Say, by adding a special label? :)

That's a very good question and that can actually be useful. Let me see!

AvdLee avatar Aug 30 '21 08:08 AvdLee

Fixed that, it should no longer happen due to the enhancement label!

AvdLee avatar Aug 30 '21 08:08 AvdLee

Thank you @AvdLee ❤️

rogerluan avatar Aug 30 '21 17:08 rogerluan

It seems like the enhancement label didn't prevent stale bot from visiting this issue again 😢

rogerluan avatar Sep 30 '21 01:09 rogerluan

I updated our stale manager, should be fixed now

AvdLee avatar Sep 30 '21 09:09 AvdLee