Fix return type for JSON.stringify(any) -> string

Fixes #18879
Problem
Current type definitions falsely assert that JSON.stringify(...) always returns a string. JSON.stringify(...) actually returns undefined whenever the input value is undefined, a Function, or a Symbol (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). It also returns undefined when a provided replacer function returns any of these types for the root value.
The fix
We provide overloads to ensure that when valid JSON values are provided, the return type is string. When an invalid value is provided, the return type is undefined as per runtime behaviour. When the input value type is any or when a replacer function is passed the return type is string | undefined.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: jupiter sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

@typescript-bot test this
@typescript-bot user test this

True, perhaps there’s a compromise to be made. I’ll have a go at removing the any input overload, or at least make that also return any, so that it is at least not a falsehood.

On 14 May 2020, at 22:40, Ryan Cavanaugh<EMAIL_ADDRESS>wrote:

@RyanCavanaugh commented on this pull request.
In src/lib/es5.d.ts:

  * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

  */

stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;

stringify(

   value: number | string | boolean | null | unknown[],

   replacer?: (number | string)[] | null,

   space?: string | number

): string;
stringify(

   value: undefined | Function | Symbol,

   replacer?: (number | string)[] | null,

   space?: any

): undefined;
stringify(
Well, you can't fix the entire world. We'll have to figure out what the right balance of correctness vs not breaking everyone is. I'll bring it up in our weekly design meeting.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@typescript-bot test this
@typescript-bot user test this

@RyanCavanaugh Can we see how the update does with user tests? I'm thinking that JSON.stringify(any) -> any will do much better. I'm thinking that JSON.stringify(any) -> string was probably a mistake originally due to the function name leading the type. A false type is worse than any.

Hopefully this can be merged soon, because this issue is bugging me a lot.

Same here.
I've shot myself in the foot because of JSON.parse(JSON.stringify(variable)), where variable suddenly became undefined and the whole expression has thrown an error.

Is this not progressing due to conflicts/an issue with the fix, or has there just not been time to merge it yet? I.e, is the blocker with the author or with maintainers? Trying to evaluate whether to submit a PR myself or not as was just bitten by this bug. (Not trying to spam here – just wondering if I can assist)

@jupiter Are you sure these types are correct?
I think it doesn't handle at least
JSON.stringify(() => {})
JSON.stringify({toJSON: () => {}})

Funny enough, even the best types I could imagine are not enough. Due to some ~bug~feature in handling of overloaded functions, union of undefined-returning and string-returning argument types is typed incorrectly.
interface Json {
    // two cases cover all types of values available in EcmaScript, except for bigint (intentionally omitted)
    stringify(value: {toJSON: () => undefined | Symbol | Function}, replacer?: (number | string)[] | null, space?: string | number): undefined;
    stringify(value: {toJSON: () => number | string | boolean | null | object}, replacer?: (number | string)[] | null, space?: string | number): string;
    stringify(value: undefined | Symbol | Function, replacer?: (number | string)[] | null, space?: string | number): undefined;
    stringify(value: number | string | boolean | null | object, replacer?: (number | string)[] | null, space?: string | number): string;
    stringify(value: any, replacer: (this: any, key: string, value: any) => number | string | boolean | null | any[] | Record<string, any>, space?: string | number): string;
    stringify(value: any, replacer: (this: any, key: string, value: any) => any, space?: string | number): string | undefined;
}
declare const Json: Json;
declare const x: (() => void) | 1;
const t4 = Json.stringify(x); // string

Can this, or some other PR that fixes #18879 , get looked at again?

Unfortunately, we never finished reviewing this PR. It is pretty old now, so I'm going to close it to reduce the number of open PRs.


Adding MessageBuilder support

This PR fixes #110 by refactoring how the publish function works and removes the reply() function.
Instead, the user can create a Publication object that builds a response or publication that can be provided to publish().
publish() now takes a Pub packet type directly which is published via MQTT.
Example:
// Construct a new message
let publication = Publication::new(payload).topic("data/topic/tree").finish().unwrap();

// Construct a response to a received message, using a default topic if none is found.
let publication = Publication::new(payload).topic("my/default/topic").reply(received_properties).finish().unwrap();

// Construct a message with a specified QoS
let publication = Publication::new(payload).topic("data/topic/tree").qos(QoS::ExactlyOnce).finish().unwrap();

// Construct a retained message
let publication = Publication::new(payload).topic("data/topic/tree").retain().finish().unwrap();

// Publish the message.
mqtt.client().publish(publication).unwrap();

This PR builds on https://github.com/quartiq/minimq/pull/109

I'll temporarily set the base branch to feature/subscription-qos to be able to review just the delta.

Feel free to change the base branch back to master before merging.


[mgmt] streamanalytics release

https://github.com/Azure/sdk-release-request/issues/4861

API change check
APIView has identified API level changes in this PR and created following API reviews.
@azure/arm-streamanalytics


Automatically install dependencies on yarn start?

Developers less familiar with modern JavaScript likely have trouble understanding why an error message like this comes up after running yarn start:

Would create-react-app benefit from adding a check on yarn start that ensures the latest dependencies are already installed?

Another thing is this could be a local file and not a module. If you use basePath in a jsconfig (or ts) to make importing from other files in your app easier, then trying to install something wont help. In this case its most likely a typo


Bug: File metadata changes not being persisted

It is possible to modify the File#metadata hash in a File#update block and not have the values persisted.

This was fixed in ea78b85.


Extreme image sharpening on Yi Home 1080p AI+

Thanks for the hard work, most of all!
Can image sharpening be disabled or at least turned down? It's atrocious on my camera.

Sorry but I don't know how to change image sharpening.

No worries, thanks!


Eliminate resourcet

This library uses MonadResource in two places: readFile and writeFile. It isn't even needed in writeFile. In readFile, it provides a dangerous opportunity to leak file descriptors since it cannot actually provide prompt finalization for a Stream.
In the spirit of pipes and pipes-safe, I'm going to remove this approach to resource management from streaming. If someone would like to create a streaming-safe package, that would be a better place to try to handle finalization correctly.

I actually had issues with the resourcet usage with streaming-bytestring.
I know in the past I was discouraged by Gabriel to try and use the -safe code with another streaming library, suggesting I use resourcet instead.
I would like to suggest usage of my streaming-with package more as the resource-management idiom for streaming.

Excellent. I’ll make that the recommendation.
Sent from my iPhone

On Oct 17, 2017, at 7:28 PM, Ivan Lazar Miljenovic<EMAIL_ADDRESS>wrote:
I actually had issues with the resourcet usage with streaming-bytestring.
I know in the past I was discouraged by Gabriel to try and use the -safe code with another streaming library, suggesting I use resourcet instead.
I would like to suggest usage of my streaming-with package more as the resource-management idiom for streaming.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Polyfill ES6 Symbol

Hi, my env:
react-native-cli : 0.1.7
react-native : 0.16.0
react-native-icons: 0.7.0
when I run my app ,I got the following error:
E/ReactNativeJS( 2973): Can't find variable: Symbol

but the Example of react-native-icons works fine.

@atom992 Probably you've some code using ES2015 Symbols? Can you share your code?

@atom992 you are probably having the same problem as me in #4587 try removing all instances of for of in your code.

@atom992 @DanielHoffmann I actually just ran into this issue on iOS 8. I personally just used the babel-polyfill (http://babeljs.io/docs/usage/polyfill/) to fix it...there are other Symbol polyfills that may be smaller (since babel-polyfill polyfills lots of things). Use at your discretion and let us know if it fixes it!

Our goal with React Native is to provide a consistent js environment across all the platforms. We should polyfill it. @skevy want to take on this task?
TaskRabbit also hit this issue because IOS 9 has Symbol but not IOS 7 and 8: http://tech.taskrabbit.com/blog/2015/12/17/react-native-launch/

any update?

ping @skevy

So, I'm sure I can bring in a symbol polyfill easy enough...but does anyone know of anything else that should be polyfilled on anything less than ios 8?

I am running on android 5.0.1 emulator, when I run as "debug in chrome",this error will not show,but when I run on real device, when ever I run as "debug in chrome" or not, I always show the error.

when I run my real device(with ./gradlew installRelease) I got the following error:
I/ReactNativeJS(31911): Running application "jarvis" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
E/ReactNativeJS(31911): Can't find variable: Symbol

I've used this polyfill and it fixed my problem:
https://github.com/medikoo/es6-symbol

https://github.com/facebook/react-native/pull/5294#issuecomment-172622214

Here's the plan:

Import the babel-plugin-symbol-member transform that we have internally: https://gist.github.com/vjeux/2715c9687653547037b0

It just replaces Symbol.iterator with typeof Symbol.iterator === 'function' ? Symbol.iterator : '@@iterator' which makes for..of work. No need to include a 24kb polyfill since the only use case is to have this variable set.

Update the JavaScript environment docs to say that we support for..of and mention the existence of this "polyfill". http://facebook.github.io/react-native/docs/javascript-environment.html#content

This happens on android for me too, like @atom992 says.

I'm getting this with for of loops, but also when using .includes on an array, which I figured would not be a problem. Went back to indexOf for now.

@zackify - want to submit a PR based on the plan that @ide quoted above? :)

@brentvatne I will have to figure out how to add that transform. I will try tomorrow night!

@zackify don't bother...just did some more investigation into that plan...see my comments on https://github.com/facebook/react-native/pull/5294#issuecomment-174397103 -- and leave your thoughts if you have anything to add! :)

@ide How Do I use this plugin?
I need it urgently. Thanks.

@babbarankit it's not super simple if you're not familiar with babel... if this is time-sensitive for you, I recommend hiring a consultant who can help you for this one task

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/polyfill-es6-symbol
ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless
Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

Hello, this is closed, but is it fixed somehow? Our app fails because we are using the ES2015 "for of" construct.

Same here. Our Application crashes on Android because of the for ... of loops.

Just import 'core-js' on Android.

Why not just automatically import 'core-js' for every Android project?

@linonetwo core-js has a lot of things and it'll slow down the initial load since we've to parse the extra unnecessary stuff now. You should manually import only the things you need from core-js

The following worked for me:
// index.android.js
import 'core-js/es6/symbol';
import 'core-js/fn/symbol/iterator';

However, this unfortunately caused other issues with other parts of my app.

@joncursi by adding this polyfill, the BackHandler subscription works again for me:
import "core-js/es6/set";


🐛 [iOS]: Resulting video recording is mirrored

What were you trying to do?
Record a video on iOS.
Reproduceable Code
No response
What happened instead?
The preview is mirrored as expected, however the resulting video is unchanged (i.e. still mirrored).
It looks as though it might have been a sneaky iOS change at some point in the last month or 2. We haven't released a new major version of our app since March, however some users have recently reported this issue in the last few weeks.
Relevant log output
No response
Device
iPhone Xs Max iOS 15.6, iPhone 13 Pro Max iOS 15.x
VisionCamera Version
2.12.0, 2.14.1
Additional information

[ ] I am using Expo
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar issues in this repository and found none.

I don't know how I missed adding a title, but I'm not surprised this was missed.

@mrousavy Any ideas why this would be happening? Or a temporary fix?

The following patch appears to fix the issue in my limited testing.
diff --git a/node_modules/react-native-vision-camera/ios/CameraView+Orientation.swift b/node_modules/react-native-vision-camera/ios/CameraView+Orientation.swift
index 5c6db1f..880c934 100644
--- a/node_modules/react-native-vision-camera/ios/CameraView+Orientation.swift
+++ b/node_modules/react-native-vision-camera/ios/CameraView+Orientation.swift
@@ -49,10 +49,10 @@ extension CameraView {
         // Run those updates on cameraQueue since they can be blocking.
         self.captureSession.outputs.forEach { output in
           output.connections.forEach { connection in
-            if connection.isVideoMirroringSupported {
-              connection.automaticallyAdjustsVideoMirroring = false
-              connection.isVideoMirrored = isMirrored
-            }
+            /*if connection.isVideoMirroringSupported {*/
+              /*connection.automaticallyAdjustsVideoMirroring = false*/
+              /*connection.isVideoMirrored = isMirrored*/
+            /*}*/
             connection.setInterfaceOrientation(connectionOrientation)
           }
         }

Will be enough to set false to isVideoMirrored in the CameraView+Orientation.swift file
connection.isVideoMirrored = false
https://github.com/mrousavy/react-native-vision-camera/blob/3ed019d018cce9ff20afb0fcc81146732419f17e/ios/CameraView%2BOrientation.swift#L39

I wonder what automaticallyAdjustsVideoMirroring actually does?

I wonder what automaticallyAdjustsVideoMirroring actually does?

As I understand correctly the automaticallyAdjustsVideoMirroring automatically adjusts the video mirroring based on the capture device's position, while isVideoMirrored allows you to explicitly set whether the video should be mirrored or not, overriding the automatic behavior.
I think it is nice to have a property for the activation mirror.

I believe in all of the Cameras I have used so far, I want the selfie cam to be mirrored (which is exactly what Snapchat and Instagram are doing). If the resulting video/photo is not mirrored, it feels weird and looks off.
I can add this prop to the backlog but will put this on very low priority as there are just a million things to do with V3 right now

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.
Video Mirroring is default for front camera

Hey all! I just spent some time to build a new feature: I created a PR to add a isMirrored prop to Camera: https://github.com/mrousavy/react-native-vision-camera/pull/3036
With this prop you can enable or disable output mirroring 🎉🥳
If you appreciate my time and dedication towards building new features and constantly improving this library, please consider sponsoring me on GitHub  :)


Entry doesn't belong in directory - Capitalization Issue

System Info:
rclone -V:
 rclone v1.37-024-g1ecf2bcbβ

uname -a (dockerized):
 Linux cfa773f6935a 4.4.52+ #1 SMP Thu Jun 15 15:23:01 PDT 2017 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a:
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

Issue
The command I am trying to run (sync a Dropbox folder)
   rclone -vv --fast-list    --bwlimit 30M --tpslimit 10.0  --config /code/rclone.config sync  dropbox:/ /backups/dropbox/

I see the following Log output:
  2017/07/26 07:46:50 ERROR : Some Example/03_for_example/zip-files/20170725.zip: Entry doesn't belong in directory "Some Example/03_For_Example/zip-files" (too short) - ignoring

It looks like Dropbox is having issues with capitalization.
Best,
Martin

Hmm, this is a problem with the new dropbox v2 API.  I will look into it!
I might need to get you to test things as I think only old files have those funny lower case paths.

Cool, thanks! Let me know if I need to test something!

@martinzellner I ran into this today and since I'm impatient I ended up changing my path /Plex/Movies to /plexy/movie on Dropbox and this finally let rclone get to the files. Dropbox is weird.

Ran into this as well.  @ncw let me know if you could use another tester or log files!

I've fixed this here - I managed to make it go wrong with my dropbox account which was a bonus - let me know how you get on!
https://beta.rclone.org/v1.37-088-gd54fca4e/ (uploaded in 15-30 mins)

Confirmed!  It's working again!!  Thank you @ncw , you are amazing!!

I think I'm hitting the same issue with the latest beta. I downloaded https://downloads.rclone.org/rclone-current-osx-amd64.zip today and ran it. It reports its version as 1.37 so maybe it's not actually a recent beta build?? Anyway, it gives me this:
2017/08/29 10:12:48 ERROR : 2017-08-6 [wb, es, od] kitesurf day/Cam3 Konstantin + Nick/REVL0001.LRV: Entry doesn't belong in directory "2017-08-6 [wb, es, od] Kitesurf Day/Cam3 Konstantin + Nick" (too short) - ignoring
2017/08/29 10:12:48 ERROR : 2017-08-6 [wb, es, od] kitesurf day/Cam3 Konstantin + Nick/REVL0001.THM: Entry doesn't belong in directory "2017-08-6 [wb, es, od] Kitesurf Day/Cam3 Konstantin + Nick" (too short) - ignoring
2017/08/29 10:12:48 ERROR : 2017-08-6 [wb, es, od] kitesurf day/Cam3 Konstantin + Nick/REVL0002.CSV: Entry doesn't belong in directory "2017-08-6 [wb, es, od] Kitesurf Day/Cam3 Konstantin + Nick" (too short) - ignoring
... etc

Interesting. The link to the latest doesn't appear to be the latest. I just downloaded the latest beta explicitly from https://beta.rclone.org/v1.37-103-g672c4102/rclone-v1.37-103-g672c4102β-osx-amd64.zip and that works fine. Isn't https://downloads.rclone.org/rclone-current-osx-amd64.zip supposed to be a link to the most recent beta?

@oliverdain wrote

Isn't https://downloads.rclone.org/rclone-current-osx-amd64.zip supposed to be a link to the most recent beta?

That is the most recent release, for the most recent beta you want https://beta.rclone.org/rclone-beta-latest-osx-amd64.zip

Hi @ncw , rclone newbie here. Just discovered your tool yesterday, looking for a way to sync my Dropbox folder to my ARMv7l based router (and use LAN syncing for the other clients at home). I'm running rclone on my Asus RT-AC68U router with Asuswrt-Merlin 380.68 firmware installed, syncing my Dropbox folder to an attached 64Gb USB 3.0 thumb drive. Ran into the same issue syncing Dropbox as the OP, found out only about half of my Dropbox contents where downloaded. Downloaded rclone-v1.37-117-g58f7b4edβ-linux-arm this morning after reading this thread as suggested. The remaining ~6Gb of data was downloaded rapidly, not a single error. Ran a sync again, rclone checked about 16000 files in about 45 seconds, no issues or errors again, so I'm really please finding this 'little' gem. Thanks, definitely very useful! Now of to dive into the documentation to see what else I can do with it :)

@ncw Thanks for such a useful tool!
Any idea when this fix might land in a stable release?

It will be in 1.38 Which is scheduled for the end of the month.

I have the same Dropbox error. I tried to install the beta. It gives me "bash: /usr/bin/rclone: cannot execute binary file: Exec format error" when running the beta.

@santoshbs make sure you downloaded the correct version for your architecture. Also try redownloading. If that doesn't help then please paste the URL that you downloaded and a bit more about your machine

root@updatesource-miami:~# timeout 1h /bin/rclone sync desktop:updatesource /web/mirror/.
2017/12/20 18:08:25 ERROR : sv-dev/: Entry doesn't belong in directory "sv-dev" (same as directory) - ignoring
2017/12/20 18:08:25 ERROR : sv/: Entry doesn't belong in directory "sv" (same as directory) - ignoring
2017/12/20 18:08:25 ERROR : gw/: Entry doesn't belong in directory "gw" (same as directory) - ignoring
2017/12/20 18:08:25 ERROR : hx/: Entry doesn't belong in directory "hx" (same as directory) - ignoring
2017/12/20 18:08:25 ERROR : hx-dev/: Entry doesn't belong in directory "hx-dev" (same as directory) - ignoring

root@updatesource-miami:~# rclone -V
rclone v1.38
- os/arch: linux/amd64
- go version: go1.9

using S3 with read-onlt IAM

@taskinosman this is a different issue - most likely #1621


CORS error using DICOMCloud with Cornerstone

I have downloaded the Cornerstone library and am using it to test the DICOMCloud server.   I use the test page provided in the project cornerstoneWADOImageLoader/examples/wadors/index.html  and provide  a wadors query which hits the DICOMCLud server (http:localhost:44301/wadors/studies/2/series/2/instances/2 )
cornerstone then makes a call to  /wadors/studies/2/series/2/instances/2/metadata which is serviced by DICOMCloud correctly
however the next call is /wadors/studies/2/series/2/instances/2/metadata/frames/1
and this call when viewed in the network panel of the Chrome debugger shows a CORS error:
Access to XMLHttpRequest at 'http://localhost:44301/wadors/studies/2/series/2/instances/2/metadata/frames/1' from origin 'null' has been blocked by CORS policy: Request header field accept is not allowed by Access-Control-Allow-Headers in preflight response.
I checked a bit on internet and it seems some accept-headers may be missing as described in SO here:
[https://stackoverflow.com/questions/32500073/request-header-field-access-control-allow-headers-is-not-allowed-by-itself-in-pr
]
I will try to add the accept headers or disable CORS,  any thoughts ?

DICOMCloud should not have wildcard accept headers by default. If you're requesting resources from a DICOMCloud instance from web page hosted at a different domain, you'll need to make sure it returns appropriate CORS Headers.
IIS supports custom headers, or the application can add them. If you're using IIS, some older versions require you to modify the handler mappings to allow the site to handle OPTIONS requests.
I'm only familiar with how you would go about doing this in .NET Core, but others here may be of more help. It's not uncommon to make the CORS options configurable with environment variables.

So DICOMcloud enabled CORS by default while it is still in beta but the problem is in the OPTIONS PreFlight Request which is sent by the browser for WADO-RS requests.
The OPTIONS PreFlight requires special handling and it is a pain in .NET Web API 2 to work.
I still need to add some documentation but I have it implemented here
Bottom line, now from the web.config you have these options:
    <add key="cors:enabled" value="true"/>
    <add key="cors:origins" value="*"/>
    <add key="cors:headers" value="*"/>
    <add key="cors:methods" value="*"/>

This is now in Development and enabled by default


If I run npm i vscode, my node_modules/vscode/vscode.d.ts contains:
        export interface ExtensionContext {
                subscriptions: { dispose(): any }[];

                workspaceState: Memento;

                globalState: Memento;

                extensionPath: string;

                asAbsolutePath(relativePath: string): string;

                storagePath: string | undefined;

                logPath: string;
        }

The globalStoragePath member seems to be missing even though it has been a part of the API since January? I can see this on vscode NPM package version 1.1.35.
Of course, since the member doesn't exist,
extContext.globalStoragePath doesn't compile, but (extContext as any)['globalStoragePath'] seems to work.

Not sure if you on the old or new world but you should be installed @types/vscode, see here for more: https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest


Docker-compose support

Add the ability to trigger docker-compose actions.
Linked to #2

Quick test :+1:
make build && AUTH_KEY=test make run
cat > /tmp/test <<EOF
version: '3'
services:
  hello:
    image: "busybox:latest"
    command: "echo world"
EOF

curl -X POST -v -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvd25lciI6Im5vIiwiYWRtaW4iOnRydWV9.SBiAoZM8Vq3wptEoJzHA9vR_VR74VBUKH6wZfOXBJg" -i -F<EMAIL_ADDRESS>http://localhost:8042/api/schedules/test

LGTM


use certifi in build

build: https://nightly.link/lepelog/ssrando/actions/runs/1478253756

didn't seem to help


Upgrade libsass to 3.5.0.beta1

Yay new beta!
Upstream has an abi breaking change which translates to a breaking change for us (SassList now has an additional required parameter)

Coverage increased (+0.03%) to 94.488% when pulling 919e4151dae2f0884a0edc54d6cc2563cc8e252b on 3_5_beta1 into 5bcefdd7c503ad1937a794511a70c2c3c6d43ab1 on master.

Coverage increased (+0.03%) to 94.488% when pulling d0d8ece55e7a4062d124267fd9b7395a957fe7ed on 3_5_beta1 into 5bcefdd7c503ad1937a794511a70c2c3c6d43ab1 on master.


Trying to insert data with python paho MQTT

Describe the bug
When trying inserting data with paho MQTT with :
import paho.mqtt.publish as publish
payload=f"""{{\n"device":"root.synox.alphitan.MD10109",\n"timestamp":100,\n"measurments":["temperature"],\n"values":[20.0]}}"""
publish.single(topic='root.synox.alphitan.MD10109', payload=payload, hostname=MQTT_IOTDB, port=MQTT_IOTDB_PORT, auth={'username':'root', 'password':'root'})

I have an error printing :
ERROR o.a.i.d.c.IoTDBDefaultThreadExceptionHandler:31 - Exception in thread pool-5-thread-5-89
java.lang.NullPointerException: null
	at org.apache.iotdb.db.mqtt.PublishHandler.onPublish(PublishHandler.java:98)
	at io.moquette.interception.BrokerInterceptor.lambda$notifyTopicPublished$3(BrokerInterceptor.java:133)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

To Reproduce
Steps to reproduce the behavior:

Define a docker volume iotdb-conf with inside a modify iotdb-engine.propertiesfile with enable_mqtt_service=trueset.
Deploy IotDB docker container with docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 1884:1883 -v iotdb-conf:/iotdb/conf -v iotdb-data:/iotdb/data -v iotdb-logs:/iotdb/logs --name iotdb apache/iotdb:latest
Try to submit previous python code

Expected behavior
Value of 20.0 to be inserted for temperature.
Desktop (please complete the following information):

OS: Docker

Additional context
No error raised by publish.single, obviously I have nothing when requesting in IotDB CLI SELECT temperature FROM root.synox.alphitan.MD10109, I can only see the error in IotDB logs.

Hi, I see a spell mistake. "measurments" -> "measurements".


forkexec: handle broken close_range() backport in openSUSE Leap 15.3

Fixes: https://discuss.linuxcontainers.org/t/lxc-exec-results-in-error-failed-to-retrieve-pid-of-executing-child-process
Signed-off-by: Christian Brauner<EMAIL_ADDRESS>

I'll backport this to our LXD package, thanks Christian.


Avoid c99 features to not reduce portability for no reason.

Hi @fobser. Thanks for the PR! Definitely willing to press the merge button, but before I do, I'd like to know the which compilers have issues with the original code. The reason I'm asking is:

I don't fully agree with "for no reason". Variable lifetime and having the compiler enforce it, is something I personally use to avoid mistakes/bugs. True, in these specific changes it's all pretty trivial, but anything I can use to avoid bugs, I usually do.
There's always the tradeoff between newer features and portability. c99 is 23 years old... If there's fairly modern compilers or operating systems that have problems with the code, then I'd like to take this as a learning opportunity. That way, in the future, I can at least make a conscious choice. Hopefully saving you the trouble of issuing a PR :slightly_smiling_face:

I fully agree with with your point 1. So far I found it good enough to declare variables in the enclosing block rather than in the loop itself, i.e.
if (foo) {
    int i;

    for (i = 0; i < 42; i++) {
    }
}

I think this reduces the scope sufficiently. I guess what I'm saying is that so far I never ran into a non-trivial situation where the scope of the variable must be inside of the loop block.
About on which compilers this causes trouble, this does not compile on OpenBSD for the sparc64, alpha and HP PA-RISC architectures (gcc 4.2.1). As well as the LUNA-88K architecture (gcc 3.x). I think it would also not compile on RHEL6 which has gcc 4.4.x and is "only" EOL for 1.5 years. Things surely move slowly...
On OpenBSD nsd is part of the base system and must be compiled on all architectures with their native compiler.
All other OpenBSD supported architectures ( https://www.openbsd.org/plat.html ) use llvm/clang.

Thanks for your comment @fobser! Judging by this table, the constructs should be supported by every compiler you mention. I want to see if I can get it to work for a bit. Should I fail, I'll happily merge the PR.

Never mind, I have just been told that -std=c99 should fix the issue. The problem is, those compilers don't do c99 by default. Sorry for the noise.
I'll close this, my mistake.

That's just what I was about to try out to update our makefile :slightly_smiling_face: (Trying to compile GCC 3.0.x on a modern system isn't the easiest :wink:) Glad it works.

This is on sparc64 with gcc version 4.2.1
checking for cc option to accept ISO C99... -std=gnu99
[...]
config.status: creating config.h
cc -std=gnu99 -I. -I/usr/src/usr.sbin/nsd -O2 -pipe   -c /usr/src/usr.sbin/nsd/answer.c
[...]

I'll ask the LUNA-88K maintainer to test on gcc3, too. Might take a while.
From what I hear from our compiler experts, it should just work.

It also works with gcc3

Thanks!


Feature Request: Support PCIe card readers (/dev/mmcblk0)

What happens?
Some PCs and laptops have a built-in SD card reader attached through a PCI express interface, not USB, which present the devices & partitions through the mmc sub-system (mmcblkXpY).
Thus, they are not detected by the script.
Your settings

OS/version: Solus 3
Version: 5c363b8

Other details:
Instead of detecting lsblk -S, use lsblk -I 8,179 instead (uppercase i followed by device types).
Since the partition naming scheme will be different (instead of ${devicePath}${i} => sdb7), it is necessary to add a special case for addressing a partition, e.g. mmcblk0p7
See https://stackoverflow.com/a/2172367 for pattern matching in Bash.

@mchubby thank you for your PR. I merged it with 1 slight change into master:
Instead of lsblk --nodeps -I 8,179 I used lsblk -d -e 7


Japanese and Korean update in hello_react

refs #82

[x] Japanese
[ ] Korean

Japanese markdown file has been updated.
#84

Updated Korean files.


Multiinstance loop v7

{placeholder}

https://github.com/apache/incubator-kie-kogito-runtimes/pull/3554


GPU acceleration support

hello, does the C++ version of the project with onnx support GPU acceleration ? and if not, is there a way to patch it?
I wanted to use Python directly to have GPU acceleration but I think the repo is not updated and I encountered a lot of problems.
thanks

Hi, I just submitted a patch to fix the performance issue on Python with GPU. #172 . Maybe it solves your issue?


Fix(web-react): Click outside hook prevents click on input label

refs #DS-879

Description

event.preventDefault in the useClickOutside hook prevents the default click on the label in the checkbox being applied and thus the input is checked.
Additional context

Issue reference

https://jira.lmc.cz/browse/DS-879
Before submitting the PR, please make sure you do the following

[ ] Read the Contributing Guidelines.
[ ] Follow the PR Title/Commit Message Convention.
[ ] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
[ ] Ideally, include relevant tests that fail without this PR but pass with it.

coverage: 96.46%. remained the same when pulling 65790ed38d97591dd0eadebd8e789393dac393b6 on fix/DS-879-web-react-prevent-default-click-outside into 045b94eccbc8db3aa5862cb834b23529f8baca34 on main.


Add flag to close cmake window after successful build and call autocommand events

Implemented a flag to close the window after a successful build #6.
I also added autocommand events after a build fails/succeeds. However, I'm not sure I did it the right way (group user)

Hey, thanks for picking this up. I have a couple of comments:

I would prefer to introduce one feature at a time. In this case, either an option to close the CMake window after successful build, or User autocommands. I would prefer the latter, as it provides more flexibility, and can be used to close the window as well as any other thing (as you pointed out in #7).

For User autocommands, I would prefer to have a new section in doc/cmake.txt, e.g. between "Mappings" and "Configuration", which we could call "Events". We could also add one or two examples in there. Remember to run vim -u NONE -c "helptags doc | q" after adding new tags to the docs.

From :help <nomodeline>:

After applying the autocommands the modelines are processed, so that their settings overrule the settings from autocommands when editing a file. This is skipped if  is specified. You probably want to use  for events not used when loading a buffer, such as User. Modelines are also skipped when no matching autocommands were executed.

This makes me think that we should to doautocmd <nomodeline> User ...

The events CMakeBuildFailed and CMakeBuildSucceeded should only trigger when calling :CMakeBuild, and not :CMakeGenerate, right?

Could you also update the CHANGELOG? I forgot to add this step inside CONTRIBUTING.md, will do that soon.

Looking forward to your updates, and thanks again!

Sorry for the late reply, I'm currently moving. I will implement your feedback this weekend.

No problem, take your time.
By the way, you might want to rebase onto master before proceeding. And regarding the examples in the docs, you could show how to jump to the first error in case of a CMakeBuildFailed (e.g. using the quickfix command :cfirst).
Thanks again!

Hi, do you still plan to work on this? Just checking.

Hi, sorry the PR got lost after I was moving. I will adjust it during the next few days.

@cdelledonne: I only kept the autocmd and adjusted the docs based on your feedback above

Applied the requested changes :)

Thanks a lot! :)
For next time, there's no need to force-push your branch, we can always squash commits when merging. Actually separating commits might help pin-pointing the changes that were made after a review.


[FLINK-36224][docs] Add the version mapping between pipeline connectors and flink

FLINK-36224

@gtk96 @yuxiqian PTAL


Oneofs and parameter flattening

Consider a oneof with two options, both of which are strings - and which we want to include in parameter flattening. We definitely can't use overloads for that, as they're the same types.
Definitely an issue for Java and C# - not sure about Go.
We spotted this a while ago, decided (I think) to implement it using oneof types like we do for resource names, but I don't think that's been implemented.
Open question: do we also stop using overloads for oneofs that currently contain different message types? Example from Datastore
It's more convenient to use overloads with GqlQuery and Query, but then if the oneof is expanded again, that doesn't work any more.
This needs addressing before GA.

@jskeet I added the Release Blocking tag, since you said this needs to be addresed before GA.

Until we have a solution, the status quo causes a bug in method samples.
Since the oneof fields will not be required the samples do not pass in a oneof field.
A temporary solution would be to add a sample code init field to the gapic yaml.

I think we should remove Go. Go doesn't implement any flattening.

https://github.com/googleapis/googleapis/pull/272 prepared to remove the datastore RunQuery flattenings that work-around the lack of proper oneof handling.
This will affect C#; do any/all other languages use gapic-generated datastore code?

Java isn't using a GAPIC client for Datastore, so Java won't be affected.

@jskeet Can you add a priority to this?

It's low priority until it's high priority, basically - we don't have any APIs that need it right now, but as soon as we do, we'll need to get it done. Setting to P2 for the moment.

@chrisdunelm Any updates on this (to meet our SLO)?

@chrisdunelm Any updates on this per our SLO?

@chrisdunelm Any updates on this? We're out of SLO.

@chrisdunelm Any updates on this? Feel free to close if this is now in the µ-generator domain.

To sum up: implement this statement in AIP:

An RPC can provide this annotation more than once to specify multiple signatures. Order matters here: In some situations, it may not be possible to generate an overload for every signature provided. In this situation, client library generators must follow a “first match wins” strategy (generate an overload for the first signature in the conflict set, and drop the rest).

Obsolete since it is not the requirement now that oneoff needs to be flattened. Hence closing this.


Add new built-in: error(msg)

Fixes: https://github.com/casey/just/issues/1073
Error will fail execution with the message given
error: Call to function `error` failed: something is wrong, yo!
   |
   24 | x := error("something is wrong, yo!")

When provided no message, it however behaves:
error: Call to function `error` failed:
   |
   24 | x := error("")

Feel free to wordsmith the readme text as desired. I consider it a rough draft at best.

As a second comment, thinking about this, it is annoying that you have to do x := error("foo") and not just error("foo"). I'm assuming that's a general grammar issue, and not something I should fix here?

I'll update the readme tonight.

Sorry for losing track of this! I don't have notifications turned on when someone pushes to a PR branch, so you have to ping me. This looks good, merging! Definitely a nice function to have.


Report Plugin: Some of the elements for the dataset render appear before disappearing on the Analysis

https://dev.nise.bbp.epfl.ch/nexus/bbp-users/nicholas/resources/https%3A%2F%2Fdev.nise.bbp.epfl.ch%2Fnexus%2Fv1%2Fresources%2Fbbp-users%2Fnicholas%2F_%2F20a58e50-5603-4b5b-b729-0640c9badba8
Some of the elements for the dataset render appear before disappearing on the Analysis
Acceptance criteria:

when a user selects the analysisReport type resource the user should not see the plus button render temporarily.

looks like a small fix to me, my estimate is 1


libiconv is still unconditionally linked to all binaries on macOS

$ rustc -Vv
rustc 1.64.0-nightly (93ffde6f0 2022-07-23)
binary: rustc
commit-hash: 93ffde6f04d3d24327a4e17a2a2bf4f63c246235
commit-date: 2022-07-23
host: aarch64-apple-darwin
release: 1.64.0-nightly
LLVM version: 14.0.6
$ cat main.rs
fn main() {}
$ rustc main.rs
$ otool -L main
main:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

The libc version in this compiler's std is 0.2.126, which includes #2150, which should have fixed this.

The problem is that I don't have a macOS machine to debug, cc @goffrie (again).

I don't think rustc cares about if functions in an extern block are used, but unconditionally considers the library referenced by the extern block used.

Interesting, I'm pretty sure you're correct. I thought I tested #2150 manually but I might have fooled myself.
In that case I'm not sure that we can actually do anything. libiconv is part of the macOS base system at least so it shouldn't pose a problem at runtime.

It poses a problem in several cases any build system that tries to accurately track dependencies or linkage has to deal with this -- you see this with the Nix discussion that seems to have referenced the issue. It causes various conflicts with C code occasionally, slows down linking/loading/startup/dlsym/etc, and so on. It would also cause massive issues for all Rust programs if libiconv ever bumped to version 8.0.0 (it's on 7.0.0), or if it bumped the soname to libiconv.3. I also think the fact that it isn't re-exported from libSystem.B.{tbd,dylib} is likely deliberate (probably due to the size -- all those conversions are not free).
Additionally, it's also essentially pointless -- nobody uses the libc bindings for these functions. There are zero hits on libc::iconv language:Rust in github's code search. Grepping for iconv language:Rust shows a number of people declaring their own bindings to the iconv functions rather than using the ones from libc. Many of these have the #[link(name = "iconv")] they'd need, and the ones that don't... well, I don't think we want to guarantee that we pull in libraries you don't use.
Concretely: std does/should not guarantee that it will any particular C library transitively, and while in this case you could make the argument that libc should... in cases like this, I'm not sure I agree. It's not like we link with all of the other things in $sdkroot/usr/lib on macOS, nor even all the other things in $sdkroot/usr/lib that are covered by POSIX, nor even everything in $sdkroot/usr/lib that is both covered by POSIX and declared in this crate.
I suppose ideally, there might be a #[link] modifier for "only link this if the things in this extern block are referenced". I dunno if that's very easy to do in the compiler, though, since that's only really known by the linker.
I thought it was weirdly needed for unwinding or something, but it's not, so it's pointless to pull this into all Rust programs. As a first step, I'll put up #[cfg_attr(not(feature = "rustc-dep-of-std"), link_name = "iconv")], which should be less controversial.


feat: initial setup KCP Watcher

Initial KCP watcher operator skeleton
Watcher CR type definition
Introduce Manifest library in Watcher control loop
Refactoring

TBH too big to review. Either We blindly pull this through or we redo some commits and split it. There are some issues like the .idea dir being still present though. For the rest I would need pointers.

I also saw the .idea stuff got pulled since .gitignore was not up to date. It should be fine now


[Bug]: ARM docker image fails with exec format error

Version Number
doesn't run
What branch are you on?
develop
Describe the Bug
From the discord:
I just updated to the latest develop from 1.15.1-develop91 and now I can't execute the docker command

receive this error standard_init_linux.go:228: exec user process caused: exec format error

I suspect this started with the addition of tini.  The CI log shows:
#8 [linux/arm64 2/7] ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /tini
#8 DONE 1.2s

That link is to the amd64 tini binary; for ARM it should presumably be: https://github.com/krallin/tini/releases/download/v0.19.0/tini-arm64
Relevant Collection/Playlist Definition
No response
Logs
no log file available; PMM won't run

@saltydk Just pinging you if you have an idea.


Updated supported MP versions for KumuluzEE

Hi @jmezna, thank you for the PR.
Could you sign the ECA and add amend your commit message to end with: Signed-off-by: name <email you used to sign ECA>, please? You can take a look at our contributing guide or more detailed guide with screenshots here.

Added ECA

@jmezna, read the guides I linked about the signature in the commit, please.

Jan Meznarič did not include the "Signed-off-by footer" which is required for all commits made by a contributor.

There are no changes but for the MP version bump and it is aligned with the wiki so I merge this PR.   Fixes #175
Watch https://gitter.im/eclipse/microprofile-starter for update on when it goes live on the testing site.


[HUDI-5479] Avoid to read the archived timeline each time for meta sync

The user reports OOM error usually because of the archived timeline deserialization, which occurs for every meta sync after an instant is committed.
Change Logs
Avoid to dese the archived timeline each instant commit.
Impact
None
Risk level (write none, low medium or high below)
none
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change

The config description must be updated if new configs are added or the default value of the configs are changed
Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
ticket number here and follow the instruction to make
changes to the website.

Contributor's checklist

[ ] Read through contributor's guide
[ ] Change Logs and Impact were stated clearly
[ ] Adequate tests were added if applicable
[ ] CI passed

also pls rebase to get the CI to pass

Close because there is another fix in: https://github.com/apache/hudi/pull/7561/files


time to update

im a student from america and i want to join softmicro to study computer science, would you please make a english version of this bible? thx a lot

The ultimate sanctity of RuanWeiBible is in its purest form only in the original sacred words written by the apostles.

The ultimate sanctity of RuanWeiBible is in its purest form only in the original sacred words written by the apostles.

逆天


TableView goes underneath UITabBar after unwinding from a modal (inverse mode)

When the view controller first loads, everything is fine -- the "first" item is displayed at the bottom of the screen, and the bottom border of that item is just above the UITabBar.   The tableView treats the top of the UITabBar as the end.
When my UITabBar performs a modal segue and then later on gets unwinded back, the tableView suddenly doesn't sense the UITabBar - it treats the bottom of the screen as the end.  The first cell is covered by the TabBar.
I'm using inverse mode and also textInputHidden = true

:+1:
When app first loads:

When the TabBar performs a modal segue and then  I unwind back to the TabBar:

(The tableView will stay like this forever, until I terminate the app)

This sort of fixed it, but I'm not sure if it's a hack or not...
override func viewDidLayoutSubviews() {
    self.tableView.contentInset = UIEdgeInsets(top: tabBarHeight, left: 0, bottom: 0, right: 0)
}


Trial test of log command to check error msg

Created specific PR to correct remaining tests fail message for log command.

Closed as issue has been resolved in another PR from Low.


Pre-create microk8s group

Create the microk8s group during runner setup.
The goal of this change is to allow the user of self-hosted runner to install microk8s and use it without sudo.

Ready for review.
Doing manual testing.


Deno 2 WASI support

Deno removed wasi from their standard library, we should use the wasi polyfill instead on Deno 2.
From https://discord.com/channels/1011124058408112148/1156304630028959824/1295444183930110013:
main.ts
import createPlugin from "npm:@extism/extism";

const plugin = await createPlugin(
  "plugin.wasm",
  { useWasi: true, runInWorker: true },
);

let out = await plugin.call("greet", "a1");
console.log(out?.text());

lib.rs (compiled to wasm32-wasi w/ release)
use extism_pdk::*;

#[plugin_fn]
pub fn greet(name: String) -> FnResult<String> {
    Ok(format!("Hello, {}!", name))
}

result:
Uncaught (in worker "") Relative import path "wasi" not prefixed with / or ./ or ../ and not in import map from "data:text/javascript;base64,dm...lots of base64...

hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:wasi").

at data:text/javascript;base64,dm...

Since wasi is deprecated in node as well, we might want to consider using the polyfill there too.


org.asciidoctor.extension.internal.ExtensionRegistryExecutor use badly service loader

Hi
Shouldnt org.asciidoctor.extension.internal.ExtensionRegistryExecutor use a ServiceLoader by classloader (ie use TCCL each time you create a new instance) to be able to pick up contextual extensions?
I particularly think to the case when adocj is in the container and some extensions in webapps for EE case
If not would be good to at least be able to switch this logic.

You mean instead of a static field holding the ServiceLoader having a field or only a local variable in registerAllExtensions()?
Sounds reasonable to me.
But I am unable to test that atm, on vacation without PC.

Am 24.04.2015 um 03:34 schrieb Romain Manni-Bucau<EMAIL_ADDRESS>Hi
Shouldnt org.asciidoctor.extension.internal.ExtensionRegistryExecutor use a ServiceLoader by classloader (ie use TCCL each time you create a new instance) to be able to pick up contextual extensions?
I particularly think to the case when adocj is in the container and some extensions in webapps for EE case
If not would be good to at least be able to switch this logic.
—
Reply to this email directly or view it on GitHub.

BTW: ServiceLoader always uses TCCL if no other ClassLoader given;-)
public static  ServiceLoader load(Class service)
Creates a new service loader for the given service type, using the current thread's context class loader.
An invocation of this convenience method of the form
ServiceLoader.load(service)
is equivalent to
ServiceLoader.load(service,
Thread.currentThread().getContextClassLoader())

You can always register the extension manually without using ServiceLoader
approach. I think it  is a workaround to that problem.
El dv., 24 abr. 2015 a les 16:50, Robert Panzer<EMAIL_ADDRESS>va escriure:

BTW: ServiceLoader always uses TCCL if no other ClassLoader given;-)
public static ServiceLoader load(Class service)
Creates a new service loader for the given service type, using the current
thread's context class loader.
An invocation of this convenience method of the form
ServiceLoader.load(service)
is equivalent to
ServiceLoader.load(service,
Thread.currentThread().getContextClassLoader())
—
Reply to this email directly or view it on GitHub
https://github.com/asciidoctor/asciidoctorj/issues/292#issuecomment-95953310
.

sure but think it doesnt hurt to update it to get it working OOTB - not a big bug BTW, no need to fix it today ;)

Fixed with 08aa3402c4d0f07786fa4ccb9fc40163d96c734e


Cross-platform make

These changes make sure the paths are escaped properly when on Windows.
(waiting on Travis to see if this builds on linux as I don't have that laptop with me today).
Edit: It's failing somewhere but I don't know where XD

Changes seem good to me, but travis is not happy.

Probably something that doesn't work in that shell 💥 . @tejasbubane could you also run these locally?  Thank you. Apparently that is one that only works on windows!

Apparently that is one that only works on windows!

You mean my fix breaks on windows?

@tejasbubane , nah your fix works everywhere, but what it was before only works on windows.

Thanks @tejasbubane for your quick fix 💯


(feature, csharp): Write Protobuf dependencies in .csproj

This updates the C# generator so that it recognizes the SourceConfig type. If any Protobuf sources are found, the new SourceFetcher abstraction is used to copy the Protobuf files into the proto directory.
With this, the .csproj file generator is updated to include file references to each of the Protobuf files which is required for grpc-dotnet code generation.

Closing this in favor of a follow-up of the same implementation, but built on top of the latest pnpm migration (link).