BOOLEAN_LITERAL seems not to work when used with alias filters.
If it’s set to false, a SPV will work ok, sending the value as 0 or 1 but a declare(“path.[atribA:1,atribB:0]”, null, {path:1}) , will send atribA as “true” and atribB as “false” instead of 1 and 0.
I’ve tried to find in the source code where is the alias filter part but I can’t figure it out … can you please give me a tip?
Hello, @zaidka , can you please help me with this issue?
Try this patch:
diff --git lib/session.ts lib/session.ts
index a07e889..50312ee 100644
--- lib/session.ts
+++ lib/session.ts
@@ -2305,9 +2305,27 @@ export async function rpcResponse(
if (!parameterList.length) {
sessionContext.rpcRequest = null;
} else {
+ const DATETIME_MILLISECONDS = !!localCache.getConfig(
+ sessionContext.cacheSnapshot,
+ "cwmp.datetimeMilliseconds",
+ {},
+ sessionContext.timestamp,
+ e => configContextCallback(sessionContext, e)
+ );
+
+ const BOOLEAN_LITERAL = !!localCache.getConfig(
+ sessionContext.cacheSnapshot,
+ "cwmp.booleanLiteral",
+ {},
+ sessionContext.timestamp,
+ e => configContextCallback(sessionContext, e)
+ );
+
const r: SetAcsRequest = {
name: "SetParameterValues",
- parameterList: parameterList
+ parameterList: parameterList,
+ DATETIME_MILLISECONDS: DATETIME_MILLISECONDS,
+ BOOLEAN_LITERAL: BOOLEAN_LITERAL
};
sessionContext.rpcRequest = r;
}
I haven’t tested this though. Please let me know it works and I’ll commit it.
Hello,
Yes, this patch fixes the issue and the SPV with alias filter works as expected now … thank you!
PS: Do you have a buymeacoffe link or something similar? I (and perhaps others) would like to show my support and appreciation for your work.
Thanks for confirming. Just comitted that upstream.
PS: Do you have a buymeacoffe link or something similar? I (and perhaps others) would like to show my support and appreciation for your work.
I don’t, but thank you You reporting the issue and testing the fix is in and of itself a valuable contribution.