Fix async bugs

This commit is contained in:
Tobe O 2018-06-10 19:17:11 -04:00
parent 156d5290c5
commit 5ea8ac31ff
12 changed files with 352 additions and 313 deletions

View file

@ -16,6 +16,13 @@
</list>
</value>
</entry>
<entry key="angel_jael">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_jael-1.0.1/lib" />
</list>
</value>
</entry>
<entry key="angel_model">
<value>
<list>
@ -79,6 +86,13 @@
</list>
</value>
</entry>
<entry key="code_buffer">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/code_buffer-1.0.0/lib" />
</list>
</value>
</entry>
<entry key="collection">
<value>
<list>
@ -128,6 +142,13 @@
</list>
</value>
</entry>
<entry key="file">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/file-2.3.7/lib" />
</list>
</value>
</entry>
<entry key="front_end">
<value>
<list>
@ -177,6 +198,13 @@
</list>
</value>
</entry>
<entry key="intl">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/intl-0.15.6/lib" />
</list>
</value>
</entry>
<entry key="io">
<value>
<list>
@ -191,6 +219,20 @@
</list>
</value>
</entry>
<entry key="jael">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/jael-1.0.4/lib" />
</list>
</value>
</entry>
<entry key="jael_preprocessor">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/jael_preprocessor-1.0.0+1/lib" />
</list>
</value>
</entry>
<entry key="js">
<value>
<list>
@ -394,6 +436,13 @@
</list>
</value>
</entry>
<entry key="symbol_table">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/symbol_table-1.0.4/lib" />
</list>
</value>
</entry>
<entry key="term_glyph">
<value>
<list>
@ -455,6 +504,7 @@
<CLASSES>
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/analyzer-0.31.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_http_exception-1.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_jael-1.0.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_model-1.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_route-2.0.5/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/args-1.4.3/lib" />
@ -464,6 +514,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/cli_util-0.1.2+1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/code_buffer-1.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/collection-1.14.9/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/combinator-1.0.0-beta+7/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/container-0.1.2/lib" />
@ -471,6 +522,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/crypto-2.0.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/csslib-0.14.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/dart2_constant-1.0.1+dart2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/file-2.3.7/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.0-alpha.9/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/glob-1.1.5/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/html-0.13.3/lib" />
@ -478,8 +530,11 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.0.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_server-0.9.7/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/intl-0.15.6/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/io-0.3.2+1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/isolate-1.1.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/jael-1.0.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/jael_preprocessor-1.0.0+1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/js-0.6.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/json_god-2.0.0-beta+1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/kernel-0.3.0-alpha.9/lib" />
@ -509,6 +564,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/stream_channel-1.6.6/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/symbol_table-1.0.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/test-0.12.36/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/tuple-1.0.1/lib" />

View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="templating.dart" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/example/templating.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$" />
<method />
</configuration>
</component>

View file

@ -2,17 +2,18 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/.idea/runConfigurations/handle_error_dart.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/runConfigurations/view_dart.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/handle_error.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/view.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/runConfigurations/templating_dart.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/templating.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/views/index.jl" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/response_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/response_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/server.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/server.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/http/angel_http.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/http/angel_http.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/http/http_response_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/http/http_response_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/performance/hello/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/performance/hello/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/controller_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/controller_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/di_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/di_test.dart" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
@ -35,29 +36,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="hooked_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/hooked_service.dart">
<file leaf-file-name="angel_http.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6336">
<caret line="403" column="30" selection-start-line="403" selection-start-column="30" selection-end-line="403" selection-end-column="30" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="raw.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/performance/hello/raw.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
<caret line="7" column="31" selection-start-line="7" selection-start-column="31" selection-end-line="7" selection-end-column="31" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="handle_error.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
<state relative-caret-position="131">
<caret line="253" column="62" selection-start-line="253" selection-start-column="62" selection-end-line="253" selection-end-column="62" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
@ -65,20 +48,52 @@
</provider>
</entry>
</file>
<file leaf-file-name="main.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<file leaf-file-name="controller_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="20" column="13" lean-forward="true" selection-start-line="20" selection-start-column="13" selection-end-line="20" selection-end-column="13" />
<state relative-caret-position="113">
<caret line="110" column="21" lean-forward="true" selection-start-line="110" selection-start-column="21" selection-end-line="110" selection-end-column="21" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name=".travis.yml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.travis.yml">
<file leaf-file-name="parameter_meta_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
<caret line="3" column="10" selection-start-line="3" selection-start-column="10" selection-end-line="3" selection-end-column="10" />
<state relative-caret-position="132">
<caret line="69" column="4" selection-start-line="69" selection-start-column="4" selection-end-line="69" selection-end-column="4" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="server_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="131">
<caret line="169" column="4" selection-start-line="169" selection-start-column="4" selection-end-line="169" selection-end-column="4" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="http.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="18" column="26" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="travis.sh" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tool/travis.sh">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file leaf-file-name="di_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/di_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="186">
<caret line="83" column="14" lean-forward="true" selection-start-line="83" selection-start-column="14" selection-end-line="83" selection-end-column="14" />
</state>
</provider>
</entry>
@ -92,75 +107,24 @@
</provider>
</entry>
</file>
<file leaf-file-name="response_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<file leaf-file-name="core.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/core.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1024">
<caret line="100" column="30" lean-forward="true" selection-start-line="100" selection-start-column="30" selection-end-line="100" selection-end-column="30" />
<state>
<folding>
<element signature="e#477#533#0" />
<element signature="e#575#591#0" />
<element signature="e#594#637#0" />
<element signature="e#1288#1362#0" />
<element signature="e#1760#1959#0" />
<element signature="e#1883#1899#0" />
<element signature="e#1912#1922#0" />
<element signature="e#1963#2006#0" />
<element signature="e#2585#2672#0" />
<element signature="e#3283#3337#0" />
<element signature="e#3406#3426#0" />
<element signature="e#3465#3504#0" />
<element signature="e#3595#3654#0" />
<element signature="e#3658#3719#0" />
<element signature="e#3992#4376#0" />
<element signature="e#4380#4480#0" />
<element signature="e#4899#5066#0" />
<element signature="e#5070#5169#0" />
<element signature="e#5309#5369#0" />
<element signature="e#6228#6267#0" />
<element signature="e#6511#7181#0" />
<element signature="e#6747#7164#1" />
<element signature="e#7282#7806#0" />
<element signature="e#7348#7593#0" />
<element signature="e#7769#7801#0" />
<element signature="e#7921#8819#0" />
<element signature="e#8079#8175#0" />
<element signature="e#8325#8376#0" />
<element signature="e#8486#8573#0" />
<element signature="e#8905#9052#0" />
<element signature="e#9056#9092#0" />
<element signature="e#9204#9488#0" />
<element signature="e#9492#9528#0" />
<element signature="e#9874#10200#0" />
<element signature="e#10316#10367#0" />
<element signature="e#10761#10843#0" />
<element signature="e#10921#11280#0" />
<element signature="e#11329#11475#0" />
<element signature="e#11523#11574#0" />
<element signature="e#11647#11688#0" />
<element signature="n#!!block;n#_LockableBytesBuilder#0" />
<element signature="e#11786#11835#0" />
<element signature="n#!!block;n#_LockableBytesBuilderImpl#0" />
<element signature="e#11967#11980#0" />
<element signature="e#12051#12099#0" />
<element signature="e#12129#12154#0" />
<element signature="e#12196#12271#0" />
<element signature="e#12310#12388#0" />
<element signature="e#12417#12440#0" />
<element signature="e#12628#12662#0" />
<element signature="e#12698#12730#0" />
<element signature="e#0#25#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="http_request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<file leaf-file-name="templating.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/templating.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="201">
<caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
<state relative-caret-position="272">
<caret line="18" column="22" selection-start-line="18" selection-start-column="22" selection-end-line="18" selection-end-column="22" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
@ -178,12 +142,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>zone</find>
<find>zone.run</find>
<find>aaa</find>
<find>close(</find>
<find>statusCode</find>
<find>.run</find>
<find>var body = await rs.fold&lt;List&lt;int&gt;&gt;([], (out, list) =&gt; []..addAll(list));</find>
<find>async =</find>
<find>async {</find>
@ -208,6 +166,12 @@
<find>beforeIndex</find>
<find>read(</find>
<find>new Trac</find>
<find>frame</find>
<find>logger.</find>
<find>Stopwa</find>
<find>handleAnge</find>
<find>errorHandl</find>
<find>handl</find>
</findStrings>
<replaceStrings>
<replace>modify</replace>
@ -260,16 +224,12 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/lib/src/core.dart" />
<option value="$PROJECT_DIR$/lib/src/core/core.dart" />
<option value="$PROJECT_DIR$/lib/angel_framework.dart" />
<option value="$PROJECT_DIR$/lib/src/stats/metric_server.dart" />
<option value="$PROJECT_DIR$/lib/http.dart" />
<option value="$PROJECT_DIR$/lib/src/core/anonymous_service.dart" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/mock_request-1.0.2/lib/src/response.dart" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/test/controller_test.dart" />
<option value="$PROJECT_DIR$/test/di_test.dart" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/mock_request-1.0.3/lib/src/response.dart" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/lib/src/core/angel_base.dart" />
@ -295,7 +255,6 @@
<option value="$PROJECT_DIR$/test/parameter_meta_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/injection.dart" />
<option value="$PROJECT_DIR$/lib/src/core/metadata.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/lib/src/core/service.dart" />
<option value="$PROJECT_DIR$/test/services_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/map_service.dart" />
@ -303,14 +262,19 @@
<option value="$PROJECT_DIR$/.travis.yml" />
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/example/async.dart" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
<option value="$PROJECT_DIR$/lib/src/http/http_response_context.dart" />
<option value="$PROJECT_DIR$/example/view.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" />
<option value="$PROJECT_DIR$/example/handle_error.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/performance/hello/main.dart" />
<option value="$PROJECT_DIR$/example/templating.dart" />
<option value="$PROJECT_DIR$/example/views/index.jl" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
<option value="$PROJECT_DIR$/test/controller_test.dart" />
<option value="$PROJECT_DIR$/test/di_test.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" />
</list>
</option>
</component>
@ -337,6 +301,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scope">
<subPane subId="Project Files">
<expand>
@ -388,7 +353,6 @@
<select />
</subPane>
</pane>
<pane id="ProjectPane" />
<pane id="AndroidView" />
<pane id="PackagesPane" />
</panes>
@ -432,7 +396,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Dart Command Line App.performance::hello (PRODUCTION)">
<component name="RunManager" selected="Dart Test.All Tests">
<configuration name="Can serialize function result as JSON in routing_test.dart" type="DartTestRunConfigurationType" factoryName="Dart Test" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/test/routing_test.dart" />
<option name="scope" value="GROUP_OR_TEST_BY_NAME" />
@ -626,6 +590,7 @@
<item itemvalue="Dart Test.can fetch data in services_test.dart" />
<item itemvalue="Dart Command Line App.view.dart" />
<item itemvalue="Dart Command Line App.handle_error.dart" />
<item itemvalue="Dart Command Line App.templating.dart" />
</list>
</component>
<component name="SvnConfiguration">
@ -705,14 +670,8 @@
<workItem from="1526439485584" duration="1904000" />
<workItem from="1528385352077" duration="29000" />
<workItem from="1528432209488" duration="9947000" />
<workItem from="1528668755509" duration="1233000" />
</task>
<task id="LOCAL-00037" summary="+3">
<created>1506275793202</created>
<option name="number" value="00037" />
<option name="presentableId" value="LOCAL-00037" />
<option name="project" value="LOCAL" />
<updated>1506275793202</updated>
<workItem from="1528668755509" duration="1661000" />
<workItem from="1528671477893" duration="1061000" />
</task>
<task id="LOCAL-00038" summary="+4">
<created>1506282194150</created>
@ -1050,16 +1009,17 @@
<option name="project" value="LOCAL" />
<updated>1528442409476</updated>
</task>
<option name="localTasksCounter" value="86" />
<task id="LOCAL-00086" summary="1.1.4+2">
<created>1528670046042</created>
<option name="number" value="00086" />
<option name="presentableId" value="LOCAL-00086" />
<option name="project" value="LOCAL" />
<updated>1528670046044</updated>
</task>
<option name="localTasksCounter" value="87" />
<servers />
</component>
<component name="TestHistory">
<history-entry file="All_Tests - 2018.06.08 at 02h 50m 09s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="can_fetch_data_in_services_test_dart - 2018.06.08 at 02h 52m 00s.xml">
<configuration name="can fetch data in services_test.dart" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="can_fetch_data_in_services_test_dart - 2018.06.08 at 02h 52m 19s.xml">
<configuration name="can fetch data in services_test.dart" configurationId="DartTestRunConfigurationType" />
</history-entry>
@ -1084,9 +1044,15 @@
<history-entry file="All_Tests - 2018.06.08 at 02h 56m 02s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="All_Tests - 2018.06.10 at 19h 13m 34s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
<history-entry file="All_Tests - 2018.06.10 at 19h 15m 03s.xml">
<configuration name="All Tests" configurationId="DartTestRunConfigurationType" />
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="146907000" />
<option name="totallyTimeSpent" value="148396000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -1116,7 +1082,7 @@
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info id="UI Designer" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39857143" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32763532" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32714286" />
<window_info anchor="bottom" id="Messages" order="7" weight="0.32285714" />
<window_info anchor="right" id="Palette&#9;" order="3" />
<window_info id="Image Layers" order="2" />
@ -1124,7 +1090,8 @@
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.4964476" visible="true" weight="0.40142858" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32905984" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.48" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24051593" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24430956" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32905984" />
<window_info anchor="right" id="SciView" order="4" />
<window_info anchor="right" id="Theme Preview" order="3" />
<window_info id="Favorites" order="3" side_tool="true" />
@ -1135,7 +1102,6 @@
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info id="DB Browser" order="2" weight="0.32998413" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32905984" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="right" id="Data View" order="4" />
@ -1149,7 +1115,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Updated tests to use `AngelHttp` API" />
<MESSAGE value="Added example/main.dart" />
<MESSAGE value="Create HttpRequestContextImpl" />
<MESSAGE value="Change return type of `AngelHttp.createRequestContext`" />
@ -1174,7 +1139,8 @@
<MESSAGE value="1.1.3" />
<MESSAGE value="Test against Dart 1.x" />
<MESSAGE value="1.1.4+1" />
<option name="LAST_COMMIT_MESSAGE" value="1.1.4+1" />
<MESSAGE value="1.1.4+2" />
<option name="LAST_COMMIT_MESSAGE" value="1.1.4+2" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1182,53 +1148,6 @@
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/lib/src/core/angel_base.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/stats/metric_server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1600">
<caret line="104" column="46" lean-forward="true" selection-start-line="104" selection-start-column="46" selection-end-line="104" selection-end-column="46" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/stats/stats.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-394" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/analysis_options.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="64">
<caret line="4" column="25" selection-start-line="4" selection-start-column="25" selection-end-line="4" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="131">
<caret line="96" column="4" selection-start-line="96" selection-start-column="4" selection-end-line="96" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/di_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="41" column="38" selection-start-line="41" selection-start-column="38" selection-end-line="41" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="28" lean-forward="true" selection-start-column="28" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/hooks.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-442">
@ -1313,13 +1232,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="109">
<caret line="64" column="24" lean-forward="true" selection-start-line="64" selection-start-column="24" selection-end-line="64" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/body_parser-1.1.0/lib/src/parse_body.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
@ -1337,13 +1249,6 @@
<entry file="file:///usr/local/opt/dart/libexec/lib/async/async.dart">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="29" column="27" lean-forward="true" selection-start-line="29" selection-start-column="27" selection-end-line="29" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/metadata.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-742">
@ -1424,13 +1329,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="7" lean-forward="true" selection-end-line="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.travis.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
@ -1445,10 +1343,86 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="243">
<caret line="237" column="31" lean-forward="true" selection-start-line="237" selection-start-column="31" selection-end-line="237" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="496">
<caret line="31" selection-start-line="31" selection-end-line="31" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/view.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
</state>
</provider>
</entry>
<entry file="file:///usr/local/Cellar/dart/2.0.0-dev.59.0/libexec/lib/core/stacktrace.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="28" column="15" lean-forward="true" selection-start-line="28" selection-start-column="15" selection-end-line="28" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.lock">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="150" column="4" selection-start-line="150" selection-start-column="4" selection-end-line="150" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
<caret line="6" selection-start-line="6" selection-end-line="9" selection-end-column="46" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/raw.dart">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret line="7" column="31" selection-start-line="7" selection-start-column="31" selection-end-line="7" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="113">
<caret line="19" column="15" lean-forward="true" selection-start-line="19" selection-start-column="15" selection-end-line="19" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="98">
<caret line="25" column="68" selection-start-line="25" selection-start-column="68" selection-end-line="25" selection-end-column="68" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/views/index.jl">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="128">
<caret line="8" column="7" selection-start-line="8" selection-start-column="7" selection-end-line="8" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1024">
<caret line="100" column="30" lean-forward="true" selection-start-line="100" selection-start-column="30" selection-end-line="100" selection-end-column="30" />
<state relative-caret-position="90">
<caret line="307" column="5" lean-forward="true" selection-start-line="307" selection-start-column="5" selection-end-line="307" selection-end-column="5" />
<folding>
<element signature="e#477#533#0" />
<element signature="e#575#591#0" />
@ -1469,80 +1443,45 @@
<element signature="e#4899#5066#0" />
<element signature="e#5070#5169#0" />
<element signature="e#5309#5369#0" />
<element signature="e#6228#6267#0" />
<element signature="e#6511#7181#0" />
<element signature="e#6747#7164#1" />
<element signature="e#7282#7806#0" />
<element signature="e#7348#7593#0" />
<element signature="e#7769#7801#0" />
<element signature="e#7921#8819#0" />
<element signature="e#8079#8175#0" />
<element signature="e#8325#8376#0" />
<element signature="e#8486#8573#0" />
<element signature="e#8905#9052#0" />
<element signature="e#9056#9092#0" />
<element signature="e#9204#9488#0" />
<element signature="e#9492#9528#0" />
<element signature="e#9874#10200#0" />
<element signature="e#10316#10367#0" />
<element signature="e#10761#10843#0" />
<element signature="e#10921#11280#0" />
<element signature="e#11329#11475#0" />
<element signature="e#11523#11574#0" />
<element signature="e#11647#11688#0" />
<element signature="n#!!block;n#_LockableBytesBuilder#0" />
<element signature="e#11786#11835#0" />
<element signature="n#!!block;n#_LockableBytesBuilderImpl#0" />
<element signature="e#11967#11980#0" />
<element signature="e#12051#12099#0" />
<element signature="e#12129#12154#0" />
<element signature="e#12196#12271#0" />
<element signature="e#12310#12388#0" />
<element signature="e#12417#12440#0" />
<element signature="e#12628#12662#0" />
<element signature="e#12698#12730#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<entry file="file://$PROJECT_DIR$/example/templating.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="243">
<caret line="237" column="31" lean-forward="true" selection-start-line="237" selection-start-column="31" selection-end-line="237" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="201">
<caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
<state relative-caret-position="272">
<caret line="18" column="22" selection-start-line="18" selection-start-column="22" selection-end-line="18" selection-end-column="22" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/view.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="131">
<caret line="261" column="35" lean-forward="true" selection-start-line="261" selection-start-column="35" selection-end-line="261" selection-end-column="35" />
<state relative-caret-position="118">
<caret line="207" lean-forward="true" selection-start-line="207" selection-end-line="207" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<entry file="file://$PROJECT_DIR$/lib/src/core/core.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="16" column="59" lean-forward="true" selection-start-line="16" selection-start-column="59" selection-end-line="16" selection-end-column="59" />
<state>
<folding>
<element signature="e#0#25#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/di_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="186">
<caret line="83" column="14" lean-forward="true" selection-start-line="83" selection-start-column="14" selection-end-line="83" selection-end-column="14" />
</state>
</provider>
</entry>
@ -1553,54 +1492,54 @@
</state>
</provider>
</entry>
<entry file="file:///usr/local/Cellar/dart/2.0.0-dev.59.0/libexec/lib/core/stacktrace.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="28" column="15" lean-forward="true" selection-start-line="28" selection-start-column="15" selection-end-line="28" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="402">
<caret line="191" column="45" selection-start-line="191" selection-start-column="45" selection-end-line="191" selection-end-column="45" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/raw.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
<caret line="7" column="31" selection-start-line="7" selection-start-column="31" selection-end-line="7" selection-end-column="31" />
</state>
</provider>
<entry file="file://$PROJECT_DIR$/tool/travis.sh">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="64">
<caret line="4" column="67" selection-start-line="4" selection-start-column="67" selection-end-line="4" selection-end-column="67" />
<first_editor relative-caret-position="48">
<caret line="3" column="51" selection-start-line="3" selection-start-column="51" selection-end-line="3" selection-end-column="51" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
<state relative-caret-position="113">
<caret line="110" column="21" lean-forward="true" selection-start-line="110" selection-start-column="21" selection-end-line="110" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="20" column="13" lean-forward="true" selection-start-line="20" selection-start-column="13" selection-end-line="20" selection-end-column="13" />
<state relative-caret-position="132">
<caret line="69" column="4" selection-start-line="69" selection-start-column="4" selection-end-line="69" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="18" column="26" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="131">
<caret line="169" column="4" selection-start-line="169" selection-start-column="4" selection-end-line="169" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="131">
<caret line="253" column="62" selection-start-line="253" selection-start-column="62" selection-end-line="253" selection-end-column="62" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>

View file

@ -1,3 +1,8 @@
# 1.1.4+3
* Don't create a Stopwatch in production.
* Fix a bug where `handleAngelHttpException` created a race condition.
* `ResponseContext.serialize` now returns a `bool`.
# 1.1.4+2
* Fix a bug that prevented proper rendering of views.
* Fixed a hidden bug that prevents error handling when a

23
example/templating.dart Normal file
View file

@ -0,0 +1,23 @@
import 'dart:io';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_jael/angel_jael.dart';
import 'package:file/local.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;
main() async {
var app = new Angel()
..lazyParseBodies = true
..logger = (new Logger('angel')..onRecord.listen(print))
..encoders.addAll({'gzip': gzip.encoder});
var fs = const LocalFileSystem();
var viewsDirPath = p.join(p.dirname(p.fromUri(Platform.script)), 'views');
await app.configure(jael(fs.directory(viewsDirPath)));
app.get('/', (ResponseContext res) => res.render('index'));
var http = new AngelHttp(app);
var server = await http.startServer('127.0.0.1', 3000);
var url = 'http://${server.address.address}:${server.port}';
print('Listening at $url');
}

9
example/views/index.jl Normal file
View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>

View file

@ -307,12 +307,12 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
/// Serializes data to the response.
///
/// [contentType] can be either a [String], or a [ContentType].
void serialize(value, {contentType}) {
bool serialize(value, {contentType}) {
if (!isOpen) throw closed();
var text = serializer(value);
if (text.isEmpty) return;
if (text.isEmpty) return true;
if (contentType is String)
headers['content-type'] = contentType;
@ -321,6 +321,7 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
write(text);
end();
return false;
}
/// Streams a file to this response.

View file

@ -304,11 +304,8 @@ class Angel extends AngelBase {
else if (result is bool) {
return result;
} else if (result != null) {
// TODO: Make `serialize` return a bool, return this as the value.
// Do this wherever applicable
res.serialize(result,
return res.serialize(result,
contentType: res.headers['content-type'] ?? 'application/json');
return false;
} else
return res.isOpen;
});

View file

@ -100,10 +100,7 @@ class AngelHttp {
if (_closed) return new Future.value(_server);
_closed = true;
_sub?.cancel();
// TODO: Remove this try/catch in 1.2.0
var close = app.close().catchError((_) => null);
return close.then((_) =>
return app.close().then((_) =>
Future.wait(app.shutdownHooks.map(app.configure)).then((_) => _server));
}
@ -135,7 +132,7 @@ class AngelHttp {
req.params.addAll(tuple.item2);
req.inject(ParseResult, tuple.item3);
if (app.logger != null)
if (!app.isProduction && app.logger != null)
req.inject(Stopwatch, new Stopwatch()..start());
var pipeline = tuple.item1;
@ -179,7 +176,8 @@ class AngelHttp {
parent.print(zone, line);
},
handleUncaughtError: (self, parent, zone, error, stackTrace) {
var trace = new Trace.from(stackTrace ?? StackTrace.current).terse;
var trace =
new Trace.from(stackTrace ?? StackTrace.current).terse;
return new Future(() {
AngelHttpException e;
@ -246,15 +244,20 @@ class AngelHttp {
}
}
if (res.isOpen) {
Future handleError;
if (!res.isOpen)
handleError = new Future.value();
else {
res.statusCode = e.statusCode;
var result = app.errorHandler(e, req, res);
app.executeHandler(result, req, res);
res.end();
handleError =
new Future.sync(() => app.errorHandler(e, req, res)).then((result) {
return app.executeHandler(result, req, res).then((_) => res.end());
});
}
return sendResponse(request, req, res,
ignoreFinalizers: ignoreFinalizers == true);
return handleError.then((_) => sendResponse(request, req, res,
ignoreFinalizers: ignoreFinalizers == true));
}
/// Sends a response.
@ -324,7 +327,7 @@ class AngelHttp {
req.injections[PoolResource].release();
}
if (app.logger != null) {
if (!app.isProduction && app.logger != null) {
var sw = req.grab<Stopwatch>(Stopwatch);
if (sw.isRunning) {

View file

@ -1,5 +1,5 @@
name: angel_framework
version: 1.1.4+2
version: 1.1.4+3
description: A high-powered HTTP server with DI, routing and more.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_framework
@ -27,6 +27,7 @@ dependencies:
stack_trace: ^1.0.0
tuple: ^1.0.0
dev_dependencies:
angel_jael: ^1.0.0
mock_request: ^1.0.0
http: ^0.11.3
test: ^0.12.13

View file

@ -112,7 +112,6 @@ main() {
Map todo = json.decode(response.body.replaceAll(rgx, ""));
print("Todo: $todo");
// expect(todo.keys.length, equals(3));
expect(todo['text'], equals("Hello"));
expect(todo['over'], equals("world"));
});

View file

@ -62,7 +62,6 @@ main() {
void validateTodoSingleton(response) {
Map todo = json.decode(response.body);
// expect(todo.keys.length, equals(3));
expect(todo["id"], equals(null));
expect(todo["text"], equals(TEXT));
expect(todo["over"], equals(OVER));