eXpl0it3r / streamdeck-clockify

Clockify Action for the Elgato Stream Deck
MIT License
51 stars 8 forks source link

Project name does not need to be unique #8

Closed eXpl0it3r closed 8 months ago

eXpl0it3r commented 1 year ago

I just learned about clients category and how you can have the same project name assigned to different clients.
This also applies to projects/clients that have been archived.

This violates the current assumptions that project names are unique and will cause a crash in the plugin:

2022-12-31 11:42:40.6582|FATAL|dev.duerrenberger.clockify|13|Unhandled Exception: System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 , Func`2 , Boolean& )
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 , Func`2 )
   at Clockify.ClockifyContext.GetRunningTimerAsync(String workspaceName, String projectName, String timeName) in D:\a\streamdeck-clockify\streamdeck-clockify\Clockify\ClockifyContext.cs:line 127
   at Clockify.ToggleAction.OnTick() in D:\a\streamdeck-clockify\streamdeck-clockify\Clockify\ToggleAction.cs:line 82
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object )
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
eXpl0it3r commented 8 months ago

This should be fixed with the rewrite done in V1.7: https://github.com/eXpl0it3r/streamdeck-clockify/releases/tag/1.7