Commit Graph

21 Commits

Author SHA1 Message Date
Jim Turner 6baedf909d Fix #1478 - Project files are not being flushed to disk after being written (#1479)
* Call fsync() before closing file

* Fix race condition in tests due to incorrect stub.

The startFlows() function wasn't really being stubbed, so it was still being called. But there was no corresponding call to stopFlows().

In later tests, the check in Flows.init() was throwing the "Cannot init without a stop" error.

* Test coverage for fsync() calls

For issue #1478

* Revert "Fix race condition in tests due to incorrect stub."

This reverts commit 4f71d7851b.

* Fix race condition in tests due to incorrect stub.

The startFlows() function wasn't really being stubbed, so it was still being called. But there was no corresponding call to stopFlows().

In later tests, the check in Flows.init() was throwing the "Cannot init without a stop" error.

* Fix intermittent test failure in Exec node.

Occasionally, the error text on stderr will come in more than one piece. The test only worked correctly if a single message was received.
2017-11-17 17:29:33 +00:00
HirokiUchikawa ff40b521b7 Fix problem with multi-byte character (#1391) 2017-09-17 08:46:14 +01:00
Kazuhito Yokoi b3ffd33507 Add file extension into flow name of library automatically (#1331) 2017-07-09 11:58:17 +01:00
Kazuhito Yokoi ac60725d2a Fix flow library in menu to support period characters as flow name (#1320) 2017-07-04 10:02:24 +01:00
Kazuki Nakanishi c34c98386e Fix creating userDir other than system drive on Windows (#1317) 2017-07-03 15:22:49 +01:00
Nick O'Leary f97f92c297
Strip BOM character from JSON files if present
Fixes #1239
2017-05-15 14:21:12 +01:00
Nick O'Leary f2235dacdc
Shuffle promises for creating default package.json 2017-01-28 14:21:22 +00:00
Nick O'Leary 85b2a03a42
Create a package.json file in userDir if one doesn't exist 2017-01-27 22:35:17 +00:00
Nick O'Leary 0a96259ddf
Update copyright header for JS Foundation 2017-01-11 15:24:33 +00:00
Nick O'Leary f0a4ea099c
Fix whitespace in localfilesystem 2017-01-08 23:01:28 +00:00
btsimonh c8d6693fba fix bug where savesettings did not honor local settings variables (#1073)
* fix bug where savesettings did not honor local settings variables

* don't create lib/flows on read;  It's already created in localfilesystem.init and in saveLibraryEntry -
so removed call to promiseDir, and added a return of [] if accessing a folder which did not exist.
This is important because else when settings.readOnly is true, it still creates folders.

* Fix a CI failure where path passed to getLibraryEntry is empty;
treat this case as meaning it was wanting a folder, and return empty if the folder dioes not exist

* Add a test for getLibraryEntry( type, '/' ) as called by node-red

* change newsettings to camelCase newSettings
2017-01-08 23:00:27 +00:00
Nick O'Leary b4be1184fd Add v2 /flows api and deploy-overwrite protection 2016-10-09 22:02:40 +01:00
Nick O'Leary f9b972349d Move credential load/save storage functions under get/setFlows 2016-09-21 21:58:50 +01:00
Nick O'Leary e06cadd761 Pass full runtime object to storage and flow sub-components 2016-09-21 10:22:04 +01:00
Nick O'Leary d6b326c134 Handle empty credentials file
Closes #937
2016-07-26 22:23:49 +01:00
Josh 3454e5ac77 Flows lib honours flowFilePretty setting (#837)
* Flow lib now adheres to pretty flow file, ui also adheres to this as well

* added settings mock object in flows_spec get api test

* reverted api changes, fixed parse of flow only

* try spell flows correctly
2016-05-17 22:09:57 +01:00
Nick O'Leary f2191e94b3 Better handling of zero-length flow files
Closes #819

If a flow file is found to be zero-bytes:
  If there is a non-empty backup, restore the backup and resolve
  If there is no backup or it is also empty, resolve empty flow
If a flow file is found to be invalid json:
  Log and resolve empty flow
2016-03-11 22:42:04 +00:00
Nick O'Leary dcd8b3699c Create node_modules in userDir
This ensures npm install puts modules under .node-red even if there's
already a node_modules dir in the parent directory.
2016-03-01 22:08:37 +00:00
Nick O'Leary 87d77efa57 Add flow reload admin api 2016-01-06 17:01:11 +00:00
Nick O'Leary f62b7afede Remove all uses of fs.exists as it is deprecated
The tests still use it in places - particular localfilesystem tests,
but those tests need to be redone with sinon stubbing in place and
not rely on real fs operations.
2016-01-06 17:01:11 +00:00
Nick O'Leary f43738446e WIP: separate runtime and api components 2016-01-06 17:01:11 +00:00