Power-Maverick / Power-Tips

Repository that provides content for each video session with code, detailed instructions, etc.
MIT License
6 stars 1 forks source link

Base class should be stateless #1

Open filcole opened 2 years ago

filcole commented 2 years ago

Hi @Power-Maverick,

Took a look at your base class - I think it might fall foul of not being stateless: https://docs.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/develop-iplugin-implementations-stateless

Particularly: https://github.com/Power-Maverick/Power-Tips/blob/aa9e2de4c698cfc6611d9013c05a09c27916d2ad/Ep-04/PowerTips.Plugins/PowerTips.Plugins.Training/PluginBase.cs#L35

If two instances of the plugin execute at once they'll share the same object, and the context could get overwritten/trashed indeterminately.

Thank you for publishing - there's always stuff in there that I learn. Please accept this as constructive criticism :)

power-maverick-bot[bot] commented 2 years ago

I am Groot!! Thanks for opening your first issue here! Please make sure you have given us as much context as possible. One of the Avengers will respond as soon as possible.

Power-Maverick commented 2 years ago

Thanks for bringing this to my attention. I will work on the fix for the Plugin Base but I am ok with accepting a PR if you already have one ready.