NubeIO / iot-engine

IoT Engine
5 stars 1 forks source link

On points-api have the ability to clear the priority array #264

Closed NubeDev closed 4 years ago

NubeDev commented 5 years ago

Brief Have the ability to send a null this will release for example if the highest is 10 and will release to 11

image

Hint The fixed should be in: https://github.com/NubeIO/iot-engine/blob/e44f9a27a7098f96a5fd58d30afe8fde405fd86b/core/iotdata/src/main/java/com/nubeiot/iotdata/dto/PointPriorityValue.java#L25

https://github.com/NubeIO/iot-engine/blob/ea83f6b7f7011a673ddd7a57146b2fa0cf6cb5e8/edge/module/datapoint/src/main/java/com/nubeiot/edge/module/datapoint/service/PointValueService.java#L39

DOD

Fixed in https://github.com/NubeIO/iot-engine/commit/182dba6235d23cfef541d649738c5fffa9aaa341 & https://github.com/NubeIO/iot-engine/pull/306/commits/16c1a5814f383668eb989d25a7e7ea4dbe6b57c9

zero88 commented 4 years ago

Reason Lack a case when handling point value = null, need to switch to current highest value Log

23:44:52.688 [vert.x-eventloop-thread-5] ERROR com.nubeiot.edge.module.datapoint.service.HistoryDataService - Failed when handle event CREATE
java.lang.NullPointerException: History data value is mandatory
    at java.util.Objects.requireNonNull(Objects.java:228)
    at com.nubeiot.edge.module.datapoint.DataPointIndex$HistoryDataMetadata.onCreating(DataPointIndex.java:261)
    at com.nubeiot.edge.module.datapoint.DataPointIndex$HistoryDataMetadata.onCreating(DataPointIndex.java:215)
    at com.nubeiot.edge.module.datapoint.service.HistoryDataService.lambda$null$2(HistoryDataService.java:81)
    at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:57)
    at io.reactivex.internal.operators.observable.ObservableAllSingle$AllObserver.onComplete(ObservableAllSingle.java:100)
    at io.reactivex.internal.operators.observable.ObservableFlatMapSingle$FlatMapSingleObserver.innerSuccess(ObservableFlatMapSingle.java:161)
    at io.reactivex.internal.operators.observable.ObservableFlatMapSingle$FlatMapSingleObserver$InnerObserver.onSuccess(ObservableFlatMapSingle.java:284)
    at io.reactivex.internal.operators.maybe.MaybeSwitchIfEmptySingle$SwitchIfEmptyMaybeObserver.onSuccess(MaybeSwitchIfEmptySingle.java:82)
    at io.reactivex.internal.operators.maybe.MaybeSwitchIfEmpty$SwitchIfEmptyMaybeObserver.onSuccess(MaybeSwitchIfEmpty.java:75)
    at io.reactivex.internal.operators.maybe.MaybeFilterSingle$FilterMaybeObserver.onSuccess(MaybeFilterSingle.java:90)
    at io.reactivex.internal.operators.maybe.MaybeSwitchIfEmptySingle$SwitchIfEmptyMaybeObserver.onSuccess(MaybeSwitchIfEmptySingle.java:82)
    at io.vertx.reactivex.impl.AsyncResultMaybe.lambda$subscribeActual$0(AsyncResultMaybe.java:49)
    at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:284)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320)
    at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)