Closed emcniece closed 7 years ago
Funny story... I ran into this problem a while back when working on another Strider plugin: https://github.com/Strider-CD/strider-extension-loader/issues/14. I didn't even remember this until coming across that issue. Time is a weird thing.
Pretty sure that complex objects can't be stored in config options because they get mapped to single strings when they get passed through to MongoDB. This means that the daySelection
array needs to be simplified.
Ok, got it figured out. In config/config.js
there are 3 updates that need to happen:
$scope.toggleDaySelection
should only push the day value to daySelection
, not the entire day object.$scope.isDaySelected
needs an empty array check before iterating$scope.isDaySelected
when comparing values should compare day.value
to obj
directly, since the new daySelection
array is values only.PR incoming.
Plugin is throwing an error on an invalid property read:
Here is the
scheduledBranch
dump, logged from an inserted line 42:After commenting line 43, Strider started again and I attempted to change the scheduled time. On saving the new settings, Strider crashed again:
Inserting another debug log before line 155 reveals that
nextTime
isnull
, and commenting line 155 allows Strider to run again - until the time comes for the job to be run. Then we crash again:Chased this through
utils.js
:getNextScheduledTime()
is returningnull
. I am trying to run tasks on a daily basis, anddays.length
is empty. When the day checkboxes are clicked in the front-end config,$scope.isDaySelected = function (day)
errors out because$scope.config.daySelection
is undefined. I have added a catch in here to establish an empty array:Days are now selected properly, and
$scope.config
looks like this:Unfortunately, clicking the save button produces an error:
The PUT request response is simply
{"error":"Failed to save plugin config"}
and theconfig.js:530
file is the Strider$.ajax
handler for save config requests. Dead ends so far.