getsentry / sentry-cordova

The official Sentry SDK for Cordova
https://sentry.io/
MIT License
68 stars 53 forks source link

plugin hook not sync, and .project.pbxproj can be changed async from other plugins too #249

Closed expcapitaldev closed 2 years ago

expcapitaldev commented 2 years ago
  1. your configuration
    <hook type="after_plugin_add" src="scripts/plugin_add_rm.js" />
    <hook type="after_platform_add" src="scripts/plugin_add_rm.js" />
    <hook type="before_plugin_rm" src="scripts/plugin_add_rm.js" />
    1. into "plugin_add_rm.js" next code: return wizard.run
    2. and "return wizard.run" do not synchronous code, it is mean all other files can change .project.pbxproj too, any plugin can rewrite your changes after hook
    3. pls check how cordova hooks work, should be used only synchronous code, not async
bruno-garcia commented 2 years ago

Sorry I'm not sure what the issue here is. Could you please explain what steps are you taking, the expected behavior and what's happening?

expcapitaldev commented 2 years ago

@bruno-garcia so, I think you know how cordova works with hooks.Cordova trigger for all plugins looks like: plugins.forEach => ... plugin.after_plugin_add it is mean if you have more than 1 plugin with other similar hooks, hook into other plugin can be started before you hook ended, and other hook can change some files too, and we will have different file content in some cases (your hook can add content or change, and other hook from other plugin can change/modify files too) so you need to have only sync (not async) code in hooks ,without micro/marco tasks , for example: Promise so, clear?

github-actions[bot] commented 2 years ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀