Caching JSON-LD from bibdata for merged JSON-LD view

Fixes #1059

Does this provide a view too?

There is an existing view in Hyrax, you can append .jsonld to the show URL (though that's broken in Plum currently).  The override of export_as_jsonld is what drives that view, see https://github.com/projecthydra-labs/hyrax/blob/master/app/controllers/concerns/hyrax/curation_concern_controller.rb#L71-L79 — we may want to do TTL and NT too.

Cool. Can you add a new ticket to fix the jsonld view, since this is gonna close #1059?

Oh, this PR fixes the JSON-LD view — the default implementation of export_as_jsonld is broken, but this overridden version fixes that.

Oh, okay. Does this build up a valid JSON-LD document for, IE, the memberOf predicate? Since Pom loads the graph.

Oh, it actually doesn't load the graph! So it'll work even if it's not valid JSON-LD.

Can we get a ticket for appending our local terms to the context? Then I'll approve and merge after CI passes.

Right now, I think it's valid JSON-LD, but not correct RDF:
"memberOf": "Test Collection"
instead of something like:
"memberOf":{"title": "Test Collection"}

Re: updating the context, I've opened a PR for that (and adding sort_title and the ARK to the bibdata output): https://github.com/pulibrary/marc_liberation/pull/217

Changes Unknown when pulling 995cabef515f50d07c239e5cb587683c8fd07742 on jsonld into ** on master**.

Coverage decreased (-0.03%) to 99.915% when pulling 04a19a545a4bd000e10d89fbaf2f8976a55dcc43 on jsonld into bf2cf5cf86abcad19f8cac18599543362a4219ec on master.

This PR now supports JSON-LD, Turtle and NTriples, and generates objects for each Collection instead of incorrectly using pcdm:memberOf "title".
There are also some updates to work around changes in the source data compared to what was in the VCR cassette.  I decided to create a new cassette for the linked data tests to get the updated bibdata context.json file, and that brought along some data changes to the sample record too.

An example:
$ curl -H "Accept: text/turtle" http://localhost:3000/concern/multi_volume_works/dc247ds08n

<http://localhost:3000/concern/multi_volume_works/dc247ds08n> <http://purl.org/dc/terms/title> "秋塍三州詩鈔 : 四卷";
   <http://iiif.io/api/presentation/2#navDate> "2017-03-29T00:00:00Z";
   <http://pcdm.org/models#memberOf> [ <http://purl.org/dc/terms/title> "East Asian Library Digital Bookshelf"];
   <http://purl.org/dc/elements/1.1/identifier> "ark:/88435/2j62s7595";
   <http://www.europeana.eu/schemas/edm/rights> "http://rightsstatements.org/vocab/NKC/1.0/";
   <http://www.w3.org/2004/02/skos/core#scopeNote> "just the good parts" .

$ curl -H "Accept: application/ld+json" http://localhost:3000/concern/multi_volume_works/dc247ds08n

{"title":"秋塍三州詩鈔 : 四卷",
 "@context":"https://bibdata.princeton.edu/context.json",
 "@id":"http://localhost:3000/concern/multi_volume_works/dc247ds08n",
 "memberOf":[{"title":"East Asian Library Digital Bookshelf"}],
 "scopeNote":["just the good parts"],
 "navDate":["2017-03-29T00:00:00Z"],
 "edm_rights":["http://rightsstatements.org/vocab/NKC/1.0/"],
 "identifier":"ark:/88435/2j62s7595"}

Coverage increased (+0.03%) to 99.972% when pulling 4df288268b9f29e505485ed9507122ab92394e33 on jsonld into bf2cf5cf86abcad19f8cac18599543362a4219ec on master.

OK, the collection objects are identified now:
{
  "title": "秋塍三州詩鈔 : 四卷",
  "@context": "https://bibdata.princeton.edu/context.json",
  "@id": "http://localhost:3000/concern/multi_volume_works/dc247ds08n",
  "memberOf": [
    {
      "@id": "http://localhost:3000/collections/dcr56n099c",
      "title": "East Asian Library Digital Bookshelf"
    }
  ],
  "scopeNote": [
    "just the good parts"
  ],
  "navDate": [
    "2017-03-29T00:00:00Z"
  ],
  "edm_rights": [
    "http://rightsstatements.org/vocab/NKC/1.0/"
  ],
  "identifier": "ark:/88435/2j62s7595"
}

Coverage increased (+0.03%) to 99.972% when pulling f9fffe7c2e61b9ec439028bb9b71d6cca4e15d51 on jsonld into bf2cf5cf86abcad19f8cac18599543362a4219ec on master.


Crashing Node after launching

Hi,
we are having problems with a strange error: Immediately after executing the sick_safetyscanners2_launch.py file, the node crashes with the message: [ERROR] [sick_safetyscanners2_node-1]: process has died [pid 900, exit code -11 ...]

This error seems related to #8 and the order in which the methods are called seems to be messed up. We alsp tried the lifecycle node from #11, since it solved the problem for them. The node also crashes after the activation of the lifecycle node.
Our setup looks like the following:
microScan3 is connected to a router with an ethernet cable. Raspberry pi 4 is connected to the router with an ethernet cable and to a second router via wifi for internet access. We are able to ping the laser scanner from the raspberry pi. The laser scanner is working with a computer using your ROS 1 packages.
We are using ROS galactic and installed your packages the following (sudo apt-get install ros-<rosdistro>-sick-safetyscanners2-interfaces sudo apt-get install ros-<rosdistro>-sick-safetyscanners-base  does not seem to work for ROS galactic as stated in #12  ):

Downloaded and installed the base (ros2 branch )following the instructions from: https://github.com/SICKAG/sick_safetyscanners_base
Downloaded the interfaces from: https://github.com/SICKAG/sick_safetyscanners2_interfaces into the colcon workspace.
Copied the base package into the colcon workspace.
colcon build
Followed the installation from source from: https://github.com/SICKAG/sick_safetyscanners2
Updating the IP adresses in the launch file accordingly.
colcon build again
Launching the node via the launch files.

Since you suggested to use gdp in #8, we also tried that, which gave use the following:

This error description does not look to promising.
Do you have any ideas? Thanks in advance!

Hi, we are looking forward to test your code changes.

Are there any updates yet?
Maybe the issue is not because of the code, but because of the scanner configuration? Do we have to change anything when switching from ROS1 to ROS2?

@Leonngm Is #15 helping ?

Hi, we are having the exact same issue! As soon as I can I will test #15!

Hi all,
just yesterday i managed to solve the issue. It is exactly what you reported in #15. I managed to solve it by discarding the data packets until everything is configured, but i guess your solution is much more elegant. As soon as everything is running, it is working like a charm.
Looking forward to test yours.

Merged PR #15
Closing this, as it should hopefully be fixed by this.
Thanks for the contribution and help in finding it.


openai[patch]: update openai params

Description: Explicitly add parameters from openai API

[X] Lint and test: Run make format, make lint and make test from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/

@efriis Fixed


Perception pipeline

Now that we have both apriltags and rock I think we are ready to implement a perception pipeline.  This issue is for discussing concrete implementation details related to this.
The current idea is to follow the planning pipeline. Here is a stab at some of the implementation details that we can do right now:

Create a prpy/perception python module
Implement a PerceptionMethod that parallels PlanningMethod
Create a prpy/perception/rock.py that implements DetectObject - this will be a PerceptionMethod
Create a prpy/perception/apriltags.py that implements DetectObjects - this will also be a PerceptionMethod
Update the robot to have something like robot.detector which parallels robot.planner and gives an ordering that the perception modules should be tried
Add the ability to call robot.

Future:

Create a simulated perception module. If the robot is started in sim mod, set robot.detector to point to this simulated perception module.
Add DetectObjects to rock

Okay, I think this captures most of what we discussed during the rock demo today. What do people think?

Wow, this sounds like a great idea.  I like paralleling PlanningMethod, perhaps we can make a PrpyMethod base implementation for adding these reflexive method chains.

Sounds great!
A few points:

Ideally, prpy/perception should handle all robot-specific things, including extrinsics and mapping perception objects to kinbodies.
In my mind, there's some YAML or other file called rock.yaml that contains the dict that maps kinbodies to perception objects. The base class then contains an object dict that loads that.
I also envisioned the DetectObjects function to take an optional list of kinbodies, if we want to focus the search for specific object sets.
In the future, we can be fancy about this: given a requested object to detect, we can automatically figure out which of our perception algorithms support its detection and call them specifically [or in some order].

Okey dokey,
I have started these changes in this branch: https://github.com/personalrobotics/prpy/tree/feature/perception_pipeline
and the associated herbpy branch of the same name.
This currently just calls the kinbody_detector, which is a separate package, and lets the kinbody_detector load objects into the environment.  Next we can work on restructuring that package and pulling some functionality into prpy (per Bullet 1 above). But have a look at that branch and make sure structurally its what we have in mind.
Next up I am going to try to create a rock detector.  Then we will need something that parallels the Sequence or Ranked MetaPlanners. I think this goes along the lines of bullet 4.

@jeking04 and I just had a chat about where to place the logic and code that updates the OpenRAVE environment. Note that this logic can be fairly complicated and possibly custom for different demos/objects  and would have to handle things like:

Persistence of objects that are not in the FOV.
Resolving IDs of multiple instances of the same object.
Filtering over time and across multiple detectors.

My suggestion is to create a perception/worldupdater.py [or something better named] that holds the logic for updating the world that takes in an env and possibly a list of whatever the detector[s] output[s] and updates the env.

anyone else noticing prpy.perception isn't showing up as a module in python?  I had to add some references to it in setup.py and init to see it

Added in #189 as part of the block sorting demo.


Bump to v0.8.5

Added

Argument --config, the user can specify a custom path for the config.yml file to be parsed
Argument --log, the user can specify a custom path for the error.log to create during execution
Support for localization

Enhancements

Added es_ES translation

Code coverage decrease (-0.22%) due to not able to mock and trigger code for filling LANG env var on non-Unix systems.
Everything else seems in order. Merging.


Upgrade to Websocket breaks Request Timeout

When a server requests an upgrade to a websocket, colly will hang indefinitely regardless of timeout settings.
Here is an example program and domain that demonstrates this problem:
package main

import (
        "fmt"
        "github.com/gocolly/colly"
        "time"
)

func main() {
        // Instantiate default collector
        c := colly.NewCollector()
        c.SetRequestTimeout(5 * time.Second)

        // Before making a request print "Visiting ..."
        c.OnRequest(func(r *colly.Request) {
                fmt.Println("Visiting", r.URL.String())
        })

        c.Visit("http://www.cccamgroup.com")
}

Here is the output from curl -L -v http://www.cccamgroup.com
* Expire in 50 ms for 1 (transfer 0x560676cdf5c0)
* Expire in 50 ms for 1 (transfer 0x560676cdf5c0)
*   Trying <IP_ADDRESS>...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x560676cdf5c0)
* Connected to www.cccamgroup.com (<IP_ADDRESS>) port 80 (#0)
> GET / HTTP/1.1
> Host: www.cccamgroup.com
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 101 Switching Protocols
< Connection: Upgrade
< Upgrade: websocket
< Sec-WebSocket-Version: 13
< Sec-WebSocket-Accept: Kfh9QIsMVZcl6xEPYxPHzW8SZ8w=
< WebSocket-Server: VaughnSoft Chat
<

Looks like the hang is happening @ ioutil.ReadAll. The problem stops occurring if you call it in a goroutine with a timeout:
	rch := make(chan error, 1)
	var body []byte
	go func() {
		body, err = ioutil.ReadAll(bodyReader)
		rch <- err
	}()
	select {
	case err = <-rch:
	case <-time.After(30 * time.Second):
		err = errors.New("read deadline reached")
	}


issues/158: when a route conflict is detected, report the correct file & line number

What:

Bugfix: When a route conflict is detected, report the correct file & line number.

Why:

Fixes: https://github.com/komuw/ong/issues/158

Codecov Report
Base: 71.12% // Head: 71.18% // Increases project coverage by +0.06% :tada:

Coverage data is based on head (2d17323) compared to base (1563c56).
Patch coverage: 88.88% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   71.12%   71.18%   +0.06%
==========================================
  Files          30       30
  Lines        2057     2065       +8
==========================================
+ Hits         1463     1470       +7
- Misses        524      525       +1
  Partials       70       70

Impacted Files
Coverage Δ

mux/route.go
84.70% <78.57%> (-0.84%)
:arrow_down:

mux/mux.go
70.83% <100.00%> (+4.16%)
:arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


From "nonPersonalizedAds" to "PersonalizedAds"

I don't know whether to call it a feature request or a consideration, but:
in the AdRequest you have added the "nonPersonalizedAds" bool. In my opinion, it is counterintuitive to enable non-personalized ads. In my opinion it is much more intuitive to enable and disable personalized ads.
Also because, usually the programmer modifies that parameter on the basis of a consent requested by the user, which is usually (in fact): do you want personalized ads? Yes or no. And therefore any bool saved by the programmer is "true" personalized ads, or false and therefore non-personalized ads.
However, the plugin thinks differently. In fact, to change that parameter I had to put:
nonPersonalizedAds: SaveData.consent == false
instead of (more intuitive):
PersonalizedAds: SaveData.consent

My proposal is therefore to change the parameter from "nonPersonalizedAds" to "PersonalizedAds", then saying "true" for personalized ads and "false" for non-personalized ads.
Then I don't know, maybe it's just me who has this reasoning problem.

Hi @Francesco-FL, thanks for filing the issue.
Considering this issue as a feature request and keeping this open for further opinions from the team. Thanks!

By default, ads are personalized unless the user opts-out of ads personalization. From the GMA SDK's perspective, this is a feature toggle: true - activate feature, false - don't activate feature.
To avoid confusion over setting the param, the User Messaging Platform SDK can be used to request and store user consent. The user's consent is referenced by the GMA SDK when making ad requests to determine ads personalization state.


fix: added ellipsis to title in Chroma Modal

fix: change Chroma Modal title to be one line and end with ellipsis.
https://user-images.githubusercontent.com/86892478/186474735-a3cd2513-e159-483b-a556-b7eb0a973738.mov

@chloecourt Looks like you'll need to amend your commit message to pass the semantic commits convention.
Something like:
fix: added ellipsis to title should do the trick

Requested review from a random @lifeomic/security team member, @cfbevan, due to term: ips.
This review is not blocking and is for broader awareness.  Consider if this change requires deeper security review and ask when it is necessary.

Automation | #pr-flagged-sec-review


How?

sorry im really new and i need this for some joy-con software and im not sure how to install it

No pro here, but have you read ?
Here : https://github.com/sam0x17/XJoy
All the instructions are there. And I don't have joycons.

@At1a the README clearly links to the download location of the setup. Once again, the issue tracker is about reporting issues, not support.
@webtroter the linked project has a misleading/useless link to ViGEm in the README, that should be rectified by the author or a PR.


If a pull request is open from source_branch -> target_branch all builds for target_branch are associated with that PR

This is causing our conditionals containing BUILDKITE_PULL_REQUEST_BASE_BRANCH to be inaccurate as we do not want certain steps to run when the BUILDKITE_PULL_REQUEST_BASE_BRANCH is target_branch. We are using github.

hi @jmdeon! this is probably something to do with the buildkite backend, rather than the agent, so we recommend getting in touch with<EMAIL_ADDRESS>


Table services sometimes copies buffers to itself

Running the TBL unit test in valgrind/memcheck reveals that under certain circumstances, the CFE_TBL_UpdateInternal() and CFE_TBL_GetWorkingBuffer() functions attempt to copy a buffer onto itself.
This is technically undefined behavior, as memcpy() requires that the source and destination not overlap.

Imported from trac issue 215.  Created by jphickey on 2017-10-25T13:33:57, last modified: 2019-03-05T14:58:28

Trac comment by jphickey on 2017-10-25 13:48:09:
Pushed branch trac-215-avoid-tbl-memcpy-overlap for CCB review, commit [changeset:8a7faa5]
Proposing that this is included in CFE 6.6 as it fixes a (potentially real) issue found running unit tests using the memory checker tool.
On many systems a memcpy() to the same buffer is probably a no-op but it is undefined in reality so we should never do that.

Trac comment by cdknight on 2017-10-27 10:43:09:
I approve, but also suggest checking that the source and target do not overlap at all, as memcpy behavior is undefined when they do. (Am curious, do many platforms support "memmove"?)
{{{
if ((*WorkingBufferPtr) != NULL && (
/* target > source + size */
(*WorkingBufferPtr)->BufferPtr > RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].BufferPtr + RegRecPtr->Size

|| /* or... */

/* target + size < source */
(*WorkingBufferPtr)->BufferPtr + RegRecPtr->Size < RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].BufferPtr)

)
}}}

Trac comment by cdknight on 2017-10-27 10:52:25:
Yeah replying to my own comment! :)
I know what we should do, we should create PSP functions to copy and move memory. Then we can ensure behavior when there's overlaps. ;)
Replying to [comment:4 cdknight]:

I approve, but also suggest checking that the source and target do not overlap at all, as memcpy behavior is undefined when they do.

Trac comment by jphickey on 2017-10-27 11:13:18:
It is also probably worth noting that this issue was found by running the unit tests, and we all know that unit tests mess with the internal state of objects to produce cases that otherwise would not occur.  It is possible that the case where source and destination are equal is because of how the UT framework set up the internal state.  (I did not investigate this).

Trac comment by jphickey on 2017-10-27 11:03:22:
memmove() is a good consideration here -- This is a standard C library function since C89 as well.
However with the way table services is implemented the pointers are selected from a pool so if there is partial overlap it means there is a more serious bug somewhere.  In this case we were only seeing 100% overlap because the same buffer was selected but the memcpy() was done unconditionally.

Trac comment by cdknight on 2017-10-27 11:19:14:
Always possible someone does something like in ticket #247, (accidentally) adding an offset to the pointer they pass to CFE_TBL_GetWorkingBuffer(). I'd say "should not occur", but might...
Replying to [comment:7 jphickey]:

It is also probably worth noting that this issue was found by running the unit tests, and we all know that unit tests mess with the internal state of objects to produce cases that otherwise would not occur.  It is possible that the case where source and destination are equal is because of how the UT framework set up the internal state.  (I did not investigate this).

Trac comment by glimes on 2017-10-27 12:31:09:
recommend approve, with the note that if overlapping buffers are possible, we should use memmove() to do the transfer.

Trac comment by jhageman on 2019-03-05 14:58:28:
Milestone renamed


Potentially use dropdown menu already instead of pressing the button to show that dropdown menu

Is it possible to instead of the button:

We directly can have dropdown menu to select ticket category?

@Sayrix any chance?

Hi, This will probably be in the next version but I don't have a lot of time to work on new feature updates so I don't have any ETA.

Hi, This will probably be in the next version but I don't have a lot of time to work on new feature updates so I don't have any ETA.

Ok no hurry, thank you so much.
Can't wait to test it.


Performance Drop

Hi there
I managed to convert the BodyPix model from tfjs model to SavedModel,
but i observed some obvious performance drop (AP DROP on segmentation)on the python model.
I tried several bodypix models in different scaling, all behaved worse than TFJS model.
Any idea? Many thanks

Hello,
without looking further into this, my suspicion is that the Python version runs on the CPU, whereas the TFJS model uses the GPU.
Running the demo reveals that the TFJS version hardly uses any CPU and hits the GPU instead: .
I'll do some more testing, but I think I might be able to add a flag to select which target hardware to run the model on.

I tested all available models in both Python and JavaScript and there is no notable performance difference if the GPU is used.
In fact, the perceived performance drop is most likely due to one of two factors:

the Python version might use the CPU instead of the GPU (the PIP version only supports NVIDIA cards and CUDA, whereas tensorflowjs can use any GPU - Intel iGPU, AMD APU, and AMD/NVIDIA GPU via their WebGL-backend)
the Python version most likely runs the model using the full input image resolution, whereas the JavaScript demo defaults low/medium resolutions
The first run will be significantly slower than subsequent inference calls, since the kernels need to be compiled and the model needs to be uploaded to the GPU.

Point 2 is especially interesting because you can test it yourself - open the demo and notice the difference in performance when switching from "medium" to "full" resolution:

"Full" resolution:

Using the full internal image resolution resulted in a massive performance drop. So unless your Python code also uses scaled-down images for inference, a big performance drop is to be expected.
Note that these run on the iGPU of my processor, because that's the default device my browser uses. Running the model on full resolution in the browser on the dedicated GPU yields about 10 fps on my test machine. The converted model did the inference on the same GPU at an average of 46 fps (measured over 100 frames). Granted, the Python test code didn't include calculating and rendering the segmentation overlay, so there's some space for performance loss there.
The converted models, however, are not tied to any particular physical device type and run on the GPU by default, provided a supported GPU and all required support libraries (CUDA 10.1 and cuDNN 7.6 as of TF 2.x) are present in the system.
I did not observe any performance degradation compared to the browser version.


Send travis-ci emails to their default recipients

R: @davorbonaci

For posterity, can you document the changes? E.g., who got the changes before vs. now.
I think the default is the committer and the commit author if they have push permissions to the repository. That's perfect for forks. However, I'd expect that commits@beam would be notified if the build is broken in a Beam repository. Thoughts? Of course, we don't want random notifications for forks otherwise.


Add Palestine 🇵🇸

Hi @ahmadRagheb
😄 see : #56

@Aissaoui-Ahmed  sorry didn't follow PR before send it .. looks great can't wait to see it there

Thank you @ahmadRagheb
Will you take a quick minute to leave a review


Call to a member function getAttributes() on null

I'm currently working on a project where I use the following libaries:

https://laraveljsonapi.io/docs/2.0/getting-started/
https://github.com/jenssegers/laravel-mongodb
https://github.com/ImanRJB/laravel-mongodb

All the relations are good, because when I do a get request on the collection it work perfectly with all his relations. But when I want to add something I got the following error:
Call to a member function getAttributes() on null

vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php :95

my body:
{
  "data": {
    "type": "foo",
    "attributes": {
      "name": "Test something",
    }
  }
}

Laravel version: 9.x
Php Version: 8.1

Stacktrace:
{
    "jsonapi": {
        "version": "1.0"
    },
    "errors": [
        {
            "detail": "Call to a member function getAttributes() on null",
            "meta": {
                "exception": "Error",
                "file": "/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php",
                "line": 95,
                "trace": [
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
                        "line": 711,
                        "function": "loadAggregate",
                        "class": "Illuminate\\Database\\Eloquent\\Collection",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
                        "line": 726,
                        "function": "loadAggregate",
                        "class": "Illuminate\\Database\\Eloquent\\Model",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel-json-api/eloquent/src/QueryBuilder/ModelLoader.php",
                        "line": 131,
                        "function": "loadCount",
                        "class": "Illuminate\\Database\\Eloquent\\Model",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel-json-api/eloquent/src/Hydrators/ModelHydrator.php",
                        "line": 101,
                        "function": "loadCount",
                        "class": "LaravelJsonApi\\Eloquent\\QueryBuilder\\ModelLoader",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel-json-api/laravel/src/Http/Controllers/Actions/Store.php",
                        "line": 64,
                        "function": "store",
                        "class": "LaravelJsonApi\\Eloquent\\Hydrators\\ModelHydrator",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
                        "line": 54,
                        "function": "store",
                        "class": "LaravelJsonApi\\Laravel\\Http\\Controllers\\JsonApiController",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
                        "line": 43,
                        "function": "callAction",
                        "class": "Illuminate\\Routing\\Controller",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
                        "line": 260,
                        "function": "dispatch",
                        "class": "Illuminate\\Routing\\ControllerDispatcher",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
                        "line": 205,
                        "function": "runController",
                        "class": "Illuminate\\Routing\\Route",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
                        "line": 725,
                        "function": "run",
                        "class": "Illuminate\\Routing\\Route",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 141,
                        "function": "Illuminate\\Routing\\{closure}",
                        "class": "Illuminate\\Routing\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/app/Http/Middleware/Control.php",
                        "line": 26,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "App\\Http\\Middleware\\Control",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel-json-api/laravel/src/Http/Middleware/BootJsonApi.php",
                        "line": 105,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "LaravelJsonApi\\Laravel\\Http\\Middleware\\BootJsonApi",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
                        "line": 50,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
                        "line": 126,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
                        "line": 102,
                        "function": "handleRequest",
                        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
                        "line": 54,
                        "function": "handleRequestUsingNamedLimiter",
                        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
                        "line": 44,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Auth\\Middleware\\Authenticate",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 116,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
                        "line": 726,
                        "function": "then",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
                        "line": 703,
                        "function": "runRouteWithinStack",
                        "class": "Illuminate\\Routing\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
                        "line": 667,
                        "function": "runRoute",
                        "class": "Illuminate\\Routing\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
                        "line": 656,
                        "function": "dispatchToRoute",
                        "class": "Illuminate\\Routing\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
                        "line": 190,
                        "function": "dispatch",
                        "class": "Illuminate\\Routing\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 141,
                        "function": "Illuminate\\Foundation\\Http\\{closure}",
                        "class": "Illuminate\\Foundation\\Http\\Kernel",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
                        "line": 21,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
                        "line": 31,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
                        "line": 21,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
                        "line": 40,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
                        "line": 27,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
                        "line": 86,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php",
                        "line": 62,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Http\\Middleware\\HandleCors",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
                        "line": 39,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 180,
                        "function": "handle",
                        "class": "Illuminate\\Http\\Middleware\\TrustProxies",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
                        "line": 116,
                        "function": "Illuminate\\Pipeline\\{closure}",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
                        "line": 165,
                        "function": "then",
                        "class": "Illuminate\\Pipeline\\Pipeline",
                        "type": "->"
                    },
                    {
                        "file": "/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
                        "line": 134,
                        "function": "sendRequestThroughRouter",
                        "class": "Illuminate\\Foundation\\Http\\Kernel",
                        "type": "->"
                    },
                    {
                        "file": "/public/index.php",
                        "line": 52,
                        "function": "handle",
                        "class": "Illuminate\\Foundation\\Http\\Kernel",
                        "type": "->"
                    }
                ]
            },
            "status": "500",
            "title": "Internal Server Error"
        }
    ]
}

The problem is in /vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php:95
because when I remove  ->whereKey($this->modelKeys())  it works correctly.

If you're working with a pivot model and running across this issue, add public $incrementing = true to your model definition.

If you're working with a pivot model and running across this issue, add public $incrementing = true to your model definition.

I already choose to change to a DB that is supported.


Internal Python Language Server error

Description
What steps will reproduce the problem?

Follow the Contributing guide:
$ conda create -n spyder-dev python=3
$ conda activate spyder-dev
$ conda install -c spyder-ide/label/dev --file requirements/conda.txt
$ python bootstrap.py
Traceback
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume
    self._handle_request(message['id'], message['method'], message.get('params'))
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request
    handler_result = handler(params)
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler
    return method(**(params or {}))
  File "/home/gary/src/spyder/external-deps/python-language-server/pyls/python_ls.py", line 208, in m_initialize
    self.config = config.Config(rootUri, initializationOptions or {},
  File "/home/gary/src/spyder/external-deps/python-language-server/pyls/config/config.py", line 53, in __init__
    entry_point.load()
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in load
    self.require(*args, **kwargs)
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2472, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/home/gary/anaconda3/envs/spyder-dev/lib/python3.8/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)

pkg_resources.VersionConflict: (python-language-server 0+untagged.1.g4d31270 (/home/gary/src/spyder/external-deps/python-language-server), Requirement.parse('python-language-server>=0.36.2')

Versions

Spyder version: 5.0.0.dev0 4d31270
Python version: 3.8.5
Qt version: 5.9.7
PyQt5 version: 5.9.2
Operating System: Linux 4.15.0-135-generic

Dependencies

# Mandatory:
atomicwrites >=1.2.0        :  1.4.0 (OK)
chardet >=2.0.0             :  4.0.0 (OK)
cloudpickle >=0.5.0         :  1.6.0 (OK)
cookiecutter >=1.6.0        :  1.7.2 (OK)
diff_match_patch >=20181111 :  20200713 (OK)
intervaltree >=3.0.2        :  3.1.0 (OK)
IPython >=7.6.0             :  7.19.0 (OK)
jedi =0.17.2                :  0.17.2 (OK)
jsonschema >=3.2.0          :  3.2.0 (OK)
keyring >=17.0.0            :  22.0.1 (OK)
nbconvert >=4.0             :  6.0.7 (OK)
numpydoc >=0.6.0            :  1.1.0 (OK)
parso =0.7.0                :  0.7.0 (OK)
pexpect >=4.4.0             :  4.8.0 (OK)
pickleshare >=0.4           :  0.7.5 (OK)
psutil >=5.3                :  5.7.2 (OK)
pygments >=2.0              :  2.7.4 (OK)
pylint >=1.0                :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0        :  0+untagged.1.g4d31270 (OK)
pyls_black >=0.4.6          :  0.4.6 (OK)
pyls_spyder >=0.3.0         :  0.3.0 (OK)
qdarkstyle >=2.8            :  2.8.1 (OK)
qtawesome >=0.5.7           :  1.0.1 (OK)
qtconsole >=5.0.1           :  5.0.1 (OK)
qtpy >=1.5.0                :  1.9.0 (OK)
rtree >=0.8.3               :  0.9.4 (OK)
setuptools >=39.0.0         :  52.0.0.post20210125 (OK)
sphinx >=0.6.6              :  3.4.3 (OK)
spyder_kernels >=2.0.0dev0  :  2.0.0.dev0 (OK)
textdistance >=4.2.0        :  4.2.0 (OK)
three_merge >=0.1.1         :  0.1.1 (OK)
watchdog >=0.10.3           :  0.10.4 (OK)
xdg >=0.26                  :  0.27 (OK)
zmq >=17                    :  20.0.0 (OK)

# Optional:
cython >=0.21               :  None (NOK)
matplotlib >=2.0.0          :  None (NOK)
numpy >=1.7                 :  None (NOK)
pandas >=1.1.1              :  None (NOK)
scipy >=0.17.0              :  None (NOK)
sympy >=0.7.3               :  None (NOK)

Hi @guangyu-shi,
Are you running the python bootstrap.py instruction in the spyder-dev environment? Or did you installed any extra package after creating the environment?

Another question for you @guangyu-shi: what command did you use to clone our git repository? Or how did you install it?
I say it because it seems you don't have any of our git tags and that's the cause of the failure.

I clone spyder's master branch.

I didn't  installed any extra package after creating the environment; running 'python bootstrap.py' hits the issue.

git tag -a v5.0.0a3 -m "my v5.0.0a3"
The above command solves the issue; the master branch has no tag associated.
Why does Python Language Server have no its own version instead of relying on tags?

Closing because you were able to solve this. The Python language server uses versioneer to define a version, and that requires a tag in the repo with the appropriate version.

I still don't understand how you manage to clone a repo without pulling its tags (I thought it was done automatically by git).

git clone --depth 1 https://github.com/spyder-ide/spyder.git
This get the master, but no any tags.

Well, that's where you deviated from our Contributing guide:

We don't suggest to use --depth 1 or other clever tricks to clone our repo.


[v4] onEnter and onChange hooks

How could we replace onEnter and onChange route hooks?
I found only 1 solution: additional <Match/> with a custom component.
This component could use something like componentWillReceiveProps to emulate onChange.
But what about onEnter? We have no lifecycle hooks that receive props on initial render.
Nice work, btw.

Thanks :)

We have no lifecycle hooks that receive props on initial render.

We no longer have a "route lifecycle". Instead, since <Match> components are real components (not pseudo-components like <Route>s were) they get to participate in React's lifecycle, which means they can just use componentWillMount.

As someone who is very new to React, I'm trying to understand if the recommended approach is to have the component being rendered with Match (e.g. /items) implement componentWillMount and possibly set data on state instead of getting data passed via props. Or how might a table row containing a link to the item details be rendered with Match (e.g. /items/:id) - seems that wouldn't be able to have the item passed to it via props if I understand how the router works.
I appreciate any guidance.

Here is an example: https://react-router.now.sh/auth-workflow

Been looking over that example, but I think I'm not understanding how that works when it's asynchronous. If, say, /items/:id requires a network call to retrieve, how would the navigation transition get blocked until the response comes back and there's something new to display?  I'd prefer not to have every page display have to have a componentWillMount empty state, if that makes sense.
It looks like there was an example that sort of went in documenting this kind of direction where the Router becomes slave to Redux, and navigations are all handled in there, but it's not part of the playground yet: https://github.com/ReactTraining/react-router/blob/7f6706dab4827afc1c26a58418f8ef8c8ab40125/website/examples/Redux.js
Is there a non-redux pattern?

Hello. I still don't understand how I'm supposed to replace onEnter with router v4. componentWill/DidMount seem "technical" hooks linked to dom lifecycle. With a route /view/:id, if I switch from /view/1 to /view/2, the same ViewComponent will be used, and componentDidMount() will not be called between the two different routes. If I'm fetching data using the :id, how I am suppose to do without an onEnter ?
(besides this problem, I'm very seduced by the rest of the API ftm =). I particularly appreciate the login redirect solution, often wanted smthg like this with old single page apps)

Hello. I still don't understand how I'm supposed to replace onEnter with router v4. componentWill/DidMount seem "technical" hooks linked to dom lifecycle. With a route /view/:id, if I switch from /view/1 to /view/2, the same ViewComponent will be used, and componentDidMount() will not be called between the two different routes. If I'm fetching data using the :id, how I am suppose to do without an onEnter ?
(besides this problem, I'm very seduced by the rest of the API ftm =). I particularly appreciate the login redirect solution, often wanted smthg like this with old single page apps)

I was thinking of using Route.render(), but I'm not sure to really understand when it can be called. It could result in useless fetching calls =/

@MathieuLorber componentWillReceiveProps

Sure, but the whole lifecycle of the component can be called for several reasons (any change in the app state). With componentWillReceiveProps, I have to check that the changed prop is the one which interests me for fetching. Or maybe by creating a dedicated wrapper component with no other props. Still, doesn't it sound a bit verbose ?

v4 is all about routes just being components. That means taking advantage of lifecycle methods.
componentWillMount() { // or componentDidMount
  fetch(this.props.match.params.id)
}

componentWillReceiveProps(nextProps) { // or componentDidUpdate
  if (nextProps.match.params.id !== this.props.match.params.id) {
    fetch(nextProps.match.params.id)
  }
}

Hmm I still must be missing something. Your proposition works in a component inside the Route, not in a component extending Route (componentWillReceiveProps is never called).
So I still need a dedicated wrapper component. And this solution is a lot more verbose + a lot more bug prone.
For the moment, using Route.render() is my best candidate. Code is there : https://gist.github.com/MathieuLorber/61ee584e375c41cd60038a11a9bf437b

What is the purpose of your <MyRoute> component?

Well, I wanted to take advantage of lifecycle methods =]

The lifecycle methods should be on the component that is rendered by the <Route>. A <Route> is just there to match its path against the current location.pathname.

Ok.
And using Route.render() for that purpose sounds like a good idea or not ?

I'm afraid I don't understand the question. Can you ask over on Reactiflux? This has turned into a bit of a conversation which would be more appropriate to have on an actual chat app :smile:.

I have a similar need to what @MathieuLorber had (thanks for posting your code, BTW). In React Router v3, I had a function that updated a store with location data on onChange() and onEnter() hooks. This saved me the trouble of writing redundant code in each Route Component's respective componentWillMount().
The best v4 equivalents I've found so far are to either make a separate component that only exists to listen to changes and update a store (envisioning something like the [withRouter example] (https://reacttraining.com/react-router/web/api/withRouter)
) or to do what @MathieuLorber has done.

I put my onEnter functions next to my actions factories. This way, all data fetching is at the same place.
So, for me, it's better to stick with v3.

Is this really something you wouldn't be willing to add to BrowserRouter? I think it's the only thing keeping us back.

Unfortunately, onEnter is one of the reasons why my project is stuck with v3.

I have a tree of deeply nested routes. Before the transition to one of them I need to fetch the data, and behave just like Github does — change url while keeping current render state, show non-blocking progress bar line in the top and then when data fetched do the actual transition.
It was pretty simple with [onEnter], because being passed with callback it blocks transition, which freeze current render state.
But now I can't find the way to prevent transition in order to wait for some job to be done. component* life cycle methods don't work for me as routes are deeply nested and calling life cycle methods will mean previous render state was dropped and new render started even before some background job is done.
What am I doing wrong? Thanks!

By the way, I'm using react-router with redux and the only way I can see so far is writing redux middleware for every app module which has components performing data fetching. Obviously I don't like it.

I am using v4, and I need to redirect to index page when user is logged in, so I decided to create temporary (hopefully..) fix to it.
Snippet:
https://gist.github.com/wzuo/e9c18132c94b5494a3156b2a2e6e57f6
onEnter function have to return redirect path if browser need to be redirected, otherwise have to return null. Also, feel free to modify it - I am getting expression based on state

@wzuo from what I see it would work for me if I had just single Switch. But in my situation it is like:
Route
  Switch
    Switch

Route

Route
  Switch

I misunderstood how react-router-redux works, injecting middleware will not help. Clicking Link or NavLink will cause changing history and triggering routes. I still can't freeze rendered state.

React doesn't offer any lifecycle hook that is triggered once, right before the initial render.
How can I emulate the onEnter behavior with the lifecycle methods?
The solutions I have in my mind are too verbose, repetitious and ugly. I still can't see the advantage of removing onEnter and onChange hooks. They were so simple...

@gsantiago

React doesn't offer any lifecycle hook that is triggered once, right before the initial render.

It does actually, it's componentWillMount. But it's still not what you want. componentWillMount + componentWillReceiveProps will do the trick, but you indeed have to check the changes of matches.

So @MathieuLorber so as everything in react-router is now a component it means that we'll need to make the calls to our auth logic inside of each routes components?

@jamiehutber ...or stick with v3 :)

Na, gotta move with the times :D I prefer it being on a component level. :p

@jamiehutber I'm not sure to understand, your auth logic works "the same". Yes, it has to be done in component lifecycle. But you still just need one component. Here is an example : https://gist.github.com/MathieuLorber/b9b257d306ef72bbd930cd609c7daa3f
(I'm not a react-router contributor, it's just my suggestion)

onEnter is beyond simple, any chance this change gets reverted?

I created a decorator that lets component check if authenticated on componentWillMount like:
// check-authenticated.js
// @flow
import React from 'react'
import PropTypes from 'prop-types'
import type { State } from '../states'

export default function checkAuthenticated (Component: Object) {
  class AuthenticatedRoute extends React.Component {
    static contextTypes = {
      store: PropTypes.object,
      router: PropTypes.object
    }
    componentWillMount () {
      const { store, router: { history, route } } = this.context
      const { session }: State = store.getState()
      if (session.userId === null) {
        const { location: { pathname } } = route
        history.replace(`/?redirect=${pathname}`)
      }
    }

    render () {
      return React.createElement(
        Component,
        { ...this.props }
      )
    }

  }

  return AuthenticatedRoute
}

You can add the decorator to auth-required pages:
// page.js
// @flow
import React, { Component } from 'react'
import checkAuthenticated from './check-authenticated'

@checkAuthenticated
export default class Page1 extends Component {
  render () {
    return (

Hello

    )
  }
}

There is a neat example of an HoC to deal with the authorization avoiding the mutiplication of ComponentWillMount and ComponentWillReceiveProps:
https://medium.com/@francoisz/react-router-v4-unofficial-migration-guide-5a370b8905a

Well, now that I've been going through this migration for half of the day, I have to say: this is really fucking aggravating.
Lifecycle hooks like componentWillMount aren't blocking, so if you call an async method there, render will run before the response comes back. Not all apps are built with this in mind, and you're forcing anyone that wants to use v4 to make a  potentially massive change to a codebase.
I don't understand why those hooks were dropped altogether. Plus, now the Routes are all over the place in the code, and I can't look at my entrypoint and understand the routing across the entire app.
The example that @mbrevda posted above (that's been thumbed down extensively) doesn't even leverage a single lifecycle hook: not a great example to say the least.
There are a handful of not-so-great solutions presented by others above, all wrapping Route or Switch in a way that should never have to be done.
There's mention in a few places of using the render prop on a Route component, but that still doesn't solve for the async scenario: if you don't return something immediately, it will throw an error.
If anyone, especially @mjackson or @mbrevda, can provide an example where a route makes an async request, and then redirects away from that component without rendering it, I'm sure we'd all be much happier for it. From what I can see thus far, it's not doable out-of-the-box.

With v4, it seems I don't have much alternative to onEnter, either using the render method which must return a null. Again, I am not able to justify why one would put a data loading or some other before side effect inside the render method. The other alternative is to use component lifecycle methods, but what if my components are stateless functional components and I do not intend to change them and introduce component lifecycle methods in them.
I like the way v4 has embraced components in routing parlance, this has made React Router a whole lot more easier to get onboarded with IMO, but there it feels there could be a better way?
Maybe I'm missing some point, please correct me If I'm wrong.

@santaclauze The HOC approach is neat indeed. I guess, will have to stick to this going forward.

I'm not worried. V3 works like a charm and @ryanflorence knows there are issues with async needs.

@oallouch Okay. Good to know that. 👍

Been converting to v4 and this is the last issue I've encountered which I can't figure out a good fix for.  I had one route with an onEnter implementation that essentially would check the url to see if there was a particular hash and key in it.  If so that meant to redirect to another page since it was coming from an ad link.  OnEnter was perfect for checking conditions like this before rendering a component.
The other suggestions about using componentWillMount and such is not good in our particular case since everything was built with stateless functional components.  Hopefully something like onEnter will be put back in v4-- apparently it's useful in many different cases just going off of this thread.

I ended up writing this HOC. Works fine for my particular needs
const withRouteOnEnter = callback => BaseComponent => {
  const routeOnEnterCallback = (props) => {
    if (callback && typeof callback === 'function') {
      callback(props)
    }
  }

  class routeOnEnterComponent extends React.Component {
    componentWillMount() {
      routeOnEnterCallback(this.props)
    }

    componentWillReceiveProps(nextProps) {
      // not 100% sure about using `locatoin.key` to distinguish between routes
      if (nextProps.location.key !== this.props.location.key) {
        routeOnEnterCallback(nextProps)
      }
    }

    render() {
      return <BaseComponent {...this.props} />
    }
  }

  return routeOnEnterComponent
}

...

const loadData = props => {
  fetchStuff(props.someId)
}

<Route path="/articles/:id" component={withRouteOnEnter(loadData)(ArticleViewContainer)} />

@dr3w this is very similar to what I'm doing. Suggesting a more generalist pattern in react-router documentation would probably be the best solution
(I wanted to work on a PR in this direction since several weeks but could take the time for the moment =s)

Let me get this straight. You would rather force a user to manually check, as opposed to using the deduction logic that onEnter provides? It doesn't make much sense to me. If something is asynchronous, now, instead of being able to rely on the data being available, we are forced to use a ternary render, and also checking for the data properly every step of the way?
It sounds like more runtime work, and it sounds like we just went back in time. Moving with the "times" is not necessarily relevant, when this is not a widely accepted standard at this point. Leaving this feature out, for almost no reason, is pretty disturbing for back-compatibility and flexibility.

@kevr it's really only a matter of async Route preparation. Unfortunately, it's ALWAYS async :)

One possible workaround for this is to use redux connect:
const mapDispatchToProps = (dispatch) => {

  /* this code executed once before rendering component */
  doSomePreparation().then((preparedData) => {
    dispatch(dataForComponentLoaded(preparedData));
  });

  return (dispatch) => ({});
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(SomeComponent);

Sorry everyone, I had to lock the conversation on this issue because it's going nowhere. The short story is your routes are just components now. Use them like any other component. The router is not a framework.


EnhancedRandom seems to not respect rules when generate collections or streams

Hello, I have been using this amazingly util library and I think I encountered that when I want to generate list or streams of some object, the enhancedRandom does not respect the provided parameters.
This is the code I am using (you can change the "generatingClass" to check the behaviour):
EnhancedRandom rand = EnhancedRandomBuilder.aNewEnhancedRandom();
Randomizer<Long> longRand = () -> (long) (rand.nextInt(99) + 1);
Randomizer<Integer> intRand = () -> rand.nextInt(200) + 1;
Randomizer<Double> doubleRand = () -> rand.nextDouble() * 100.0;
EnhancedRandom enhancedRandom = EnhancedRandomBuilder.aNewEnhancedRandomBuilder()
		.scanClasspathForConcreteTypes(true).overrideDefaultInitialization(true).collectionSizeRange(0, 10)
		.stringLengthRange(8, 15).dateRange(LocalDate.of(1980, 1, 1), LocalDate.now())
		.timeRange(LocalTime.of(1, 0, 0), LocalTime.of(23, 0, 0)).randomize(Long.class, longRand)
		.randomize(Integer.class, intRand).randomize(Double.class, doubleRand).build();

Class generatingClass = Integer.class;
Integer listSize = longRand.getRandomValue().intValue();
List randomInstances = new ArrayList<>(listSize);
IntStream.rangeClosed(1, listSize)
		.forEach(i -> randomInstances.add(enhancedRandom.nextObject(generatingClass)));
logger.info("objectsOneByOne: " + randomInstances);
logger.info("objectsList: " + enhancedRandom.randomListOf(listSize, generatingClass));

And this is the output:
INFO - objectsOneByOne: [35, 23, 108, 125, 196, 37, 70, 76, 185, 181, 122, 184, 27, 47, 16, 153, 167, 199, 139, 158, 48, 21, 185, 129, 39, 41, 170, 103, 96, 57, 55, 166, 178, 13, 64, 191, 82, 25, 177, 58, 84, 161, 170, 153, 168, 124, 10, 141, 109, 95, 143, 84, 69, 42, 93, 164, 180, 184, 33, 10, 61, 104, 32, 11, 115, 176, 96, 156, 82, 161, 123, 164, 144, 93, 76, 166]
INFO - objectsList: [-1514334470, -2075070463, 224962436,<PHONE_NUMBER>, 251248171,<PHONE_NUMBER>,<PHONE_NUMBER>, 749510790,<PHONE_NUMBER>, 970819133, 64786774,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>, 258063342, 208674894,<PHONE_NUMBER>, -849290998, -2005634300, -1905198479,<PHONE_NUMBER>, -2073512300, -1793719094,<PHONE_NUMBER>, -1786623429, -692895629,<PHONE_NUMBER>, -706632473, -908224744, 959505378, 210162770, -20890847, -555812803, -1416142717, 105565746, -666370826, -49159426, -34169177,<PHONE_NUMBER>, -1315386480,<PHONE_NUMBER>, 449717709, -1931540333, -1393642139,<PHONE_NUMBER>, -1541081239,<PHONE_NUMBER>, -160343913, -1483177709, -235023899,<PHONE_NUMBER>, -1644001380, 901174421,<PHONE_NUMBER>, -1965006343, -433122271, -1417899163, 264116197, -1379287643, -1197022165, -1504091528,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>, -1994084281, -614774551, 327270638,<PHONE_NUMBER>, -849853541, -1867663189, -1984243496, -1175240218, 996434858, -601714541, -239373879,<PHONE_NUMBER>]

Hi marcovb279,
sorry for the confusion, but static methods of EnhancedRandom like randomListOf do not use the configuration created with EnhancedRandom. If you use EnhancedRandom#objects to generate a Stream (collect it to a List, Set etc. if you require a different collection type) it should work.
Cheers,
Pascal

Hi @marcovb279
As @PascalSchumacher said, static methods do not take into account configuration parameters. Sorry for the confusion.
@PascalSchumacher This is not the first time this confusion occurs ( see issue #254 and issue #198 ). It is time to document it clearly in the wiki and Javadoc. I will take care of that.
@marcovb279 Give it a try with EnhancedRandom#objects, it should work fine. If it is the case, don't hesitate to close the issue.
Kind regards
Mahmoud

Thank you for the clarification @PascalSchumacher @benas, I hadn't noticed the static methods.
I have tested with EnhancedRandom#objects and it works fine.
I close the issue.
Regards


Adjusted alerting plugin branch used by test workflows.

Signed-off-by: AWSHurneyt<EMAIL_ADDRESS>Description
Adjusted alerting plugin branch used by test workflows.
Issues Resolved
[List any issues this PR will resolve]
Check List

[ ] New functionality includes testing.

[ ] All tests pass

[ ] New functionality has been documented.

[ ] New functionality has javadoc added

[x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Codecov Report

Merging #390 (d38a5e8) into 2.0 (95f5b37) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              2.0     #390      +/-   ##
==========================================
- Coverage   52.73%   52.68%   -0.06%
==========================================
  Files         209      207       -2
  Lines        5450     5442       -8
  Branches      763      763
==========================================
- Hits         2874     2867       -7
+ Misses       2574     2573       -1
  Partials        2        2

Impacted Files
Coverage Δ

...plugins/alerting-dashboards-plugin/babel.config.js

...gins/alerting-dashboards-plugin/utils/constants.js

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Single click WYSIWYG cell editing in Notebooks

Request that the notebook experience allows for 1-click editing for notebook cells when in Preview mode. One challenge our customers are facing is the numerous amount of clicks needed to get started in editing their content. In OneNote this is very simple -- 1 click and start typing away. In the notebook experience, 1 click to select the cell, and double click to focus on the cell's text in preview mode.
Talking to Raden, it seems that this was intentional in the past since Markdown was the primary form of writing content into the cell. From what I gather, single click editing was not pursued due to the the cursor landing in an inappropriate place in the markdown whenever the user clicked on the preview mode. Fortunately, this is no longer the case as we now can edit the content in the preview mode as well thanks to the WYSIWYG.
Describe the solution or feature you'd like
Request single-click editing in notebook cells. Some visual cues may be useful, such as border highlight on cell on hover, etc. We need to loop Raden on this.
Describe alternatives you've considered
None that I can think of so far.
Additional context
We need to make notebook editing as simple as OneNote make it for users to edit content. Anything else is felt like a challenging experience to our users.

Chatted offline. Working with design.


Fix a problem when generating conformers for molecules with larger heteroatoms in conjugated 5-rings

What happens here is that the S atom in the ring can distort things enough that the usual distance bounds that we use end up failing bounds smoothing.
This fix adds some extra padding to both the upper and lower diagonals of the bounds matrix when atoms with atomic numbers larger than 10 are involved in conjugated bonds in 5 rings.

@sriniker do you have time to take a look at this change? This should, hopefully fix the problem that @candidechamp reported a while ago and that we discussed.

Merging after @sriniker's review


Updated jquery.sparkline to 2.1.1, rails 4 compatibility, changed asset name

I changed the asset name because a lot of gems that wrap jquery plugins use the jquery.<plugin_name> convention.
Also, Rails 4 doesn't seem to recursively pick up assets in vendor/assets/javascript/, so I moved the asset directly under that path.
Thanks.

I'd love to see this merged, I have the same issue that I am on Rails 4, and it burps on bundle install


Compact: Old chunks left on disk and not cleaned up.

Thanos, Prometheus and Golang version used
thanos, version 0.1.0-rc.2 (branch: HEAD, revision: 53e4d69ebba12baef46543468992619fcfd524ef)
  build user:       circleci@8ad520887cbd
  build date:       20180705-12:59:08
  go version:       go1.10.3

What happened

when running thanos compact chunks are not always cleaned up once compaction is done.
could also be that a crash occurs during compaction and is not cleaned correctly on relaunch.

/ # du -h /compactor-data/ | grep chunks
1.8G    /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKS4D2PAAX9ECFGTQ0NK9RE5/chunks
757.9M  /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKS3NSKE8B8ZMVRQGAJSZ8NZ/chunks
4.7G    /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKSEFT7RB95QZPE05Y542ZQ4/chunks
6.4M    /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKZVATTP23ZGTWYMJS8Y0FY2/chunks
2.2G    /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKSHYHH4B939PJ3M2SF7R3DE/chunks
964.4M  /compactor-data/compact/0@{cluster="prod",monitor="prom"}/01CKSAS90T7YG7YWT5C3EAY76H/chunks

What you expected to happen

would not expect old chunks to be filling up disk space

How to reproduce it (as minimally and precisely as possible):
Full logs to relevant components
level=info name=simcompact ts=2018-08-07T11:03:12.786002152Z caller=compact.go:132 msg="start of GC"
level=debug name=simcompact ts=2018-08-07T11:03:18.813641778Z caller=compact.go:708 compactionGroup="0@{cluster=\"prod\",monitor=\"prom\"}" msg="downloaded and verified blocks" blocks="[/compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSPV3BZ7MX565RMMQESNTME /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSXPTKZV6KJ1BDHVWQSFRNM /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKT4JHVZRVA9EZN09KHVXSFA /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKTBEDACVYQN3VCZTPYHWABJ]" duration=5.843152132s
level=error name=simcompact ts=2018-08-07T11:03:18.842460557Z caller=compact.go:203 msg="critical error detected; halting" err="compaction: compact blocks [/compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSPV3BZ7MX565RMMQESNTME /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSXPTKZV6KJ1BDHVWQSFRNM /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKT4JHVZRVA9EZN09KHVXSFA /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKTBEDACVYQN3VCZTPYHWABJ]: 5 errors: write compaction: write chunks: no space left on device; setting compaction failed for block: /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSPV3BZ7MX565RMMQESNTME: write /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSPV3BZ7MX565RMMQESNTME/meta.json.tmp: no space left on device; setting compaction failed for block: /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSXPTKZV6KJ1BDHVWQSFRNM: write /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKSXPTKZV6KJ1BDHVWQSFRNM/meta.json.tmp: no space left on device; setting compaction failed for block: /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKT4JHVZRVA9EZN09KHVXSFA: write /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKT4JHVZRVA9EZN09KHVXSFA/meta.json.tmp: no space left on device; setting compaction failed for block: /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKTBEDACVYQN3VCZTPYHWABJ: write /compactor-data/compact/0@{cluster=\"prod\",monitor=\"prom\"}/01CKTBEDACVYQN3VCZTPYHWABJ/meta.json.tmp: no space left on device"

Anything else we need to know

Hey @jojohappy, Basically those old files are never used again. So there must be some bug. Maybe during some fail on compaction, compactor is not cleaning some tmp dirs? I think on startup compactor could remove all temp directories as it does not need any of those. That would fix the symptom, but will not fix the issue.

@bwplotka I see a use case, if user changes the temp directory for the next execution, the proposal will not fix the problem. But it is a user action, we could not take care about that.
So I think we should make compactor stronger and clean the temp directory when it is success, and clean it when compactor starts too.


XamlListView -> TapOnTheEdge sample problems

Several problems with this samlpe, specifically with EdgeTappedListView class:

ShowVisual method failes with ArgumentException if item template for EdgeTappedListView doesn't contain any row definitions. Reason is in this code:
if (panel is Grid)
{
    this.visualIndicator.SetValue(Grid.RowSpanProperty, (panel as Grid).RowDefinitions.Count);
}

which tries to set Grid.RowSpanProperty to zero.

Each tap on edge expands item height if there is any top or bottom Padding set for root grid of item template, e.g.:
<DataTemplate x:Name="ContactListViewTemplate" x:DataType="data:Contact">
    <Grid Padding="0 5 0 5">
        <Grid.RowDefinitions>
        ...

Tap on edge does not garantee that tapped item will be selected after setting ListViewSelectionMode to Multiple. Sometimes EdgeTappedListView goes to selection mode with check boxes all been clear, which kind of contrary with idea that it should come back to normal mode after deselecting all items. You can reproduce this behavior by tapping different area in bounds of HIT_TARGET.

Feature team has chosen to resolve as "Won't fix". You are welcome to try to fix it yourself.


Add option to persist files and content

I understand that you intentionally built this to dynamically populate the file's text on access to allow for dynamically switching between versions and remove the need to have the entire Bible downloaded on disk in your vault. However, it would be nice if you added an option to allow us to choose that functionality anyway.
Perhaps adding a flag that tells your plugin to go ahead and download the chosen translation's content into all of the chapter files and persist it as an offline copy.

You can build your Bible with the text of a specific translation baked in by disabling the Build with dynamic verses toggle in the Book builder menu, before you build your Bible.

Does this help?


refactor: replace extend with toObject

What kind of change does this PR introduce? (check at least one)

[ ] Bugfix
[ ] Feature
[ ] Code style update
[x] Refactor
[ ] Build-related changes
[ ] Other, please describe:

Does this PR introduce a breaking change? (check one)

[ ] Yes
[x] No

If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:

[x] It's submitted to the dev branch for v2.x (or to a previous version branch), not the master branch
[x] When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
[x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
[ ] New/updated tests are included

If adding a new feature, the PR's description includes:

[ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Thanks for the PR - it is slightly more semantic to use toObject, but is less efficient (extra allocation of array + iteration)


Crashes If Copying Large File/Folder and Open Large Folder Simultaneously

Explain the bug
Files crashes or closes unexpectedly if users copying large file (up to 3gb) and open large folder simultaneously.
To reproduce

Open New Tabs
Copy a Large File/Folder
While the app is copying the file(s), try open large folder simultaneously
See the error

Expected behavior
Files shouldn't crash or closes unexpectedly.
Logfile
Upload the log file here for us to understand your issue better.

You can access it from Settings->About->Open log location.
or
Copy the debug.log and debug_fulltrust.log from the following directory, and upload the files here.
%localappdata%\Packages\49306atecsolution.FilesUWP_et10x9a9vyk8t\LocalState
debug_fulltrust.txt
debug.txt

Screenshots
https://user-images.githubusercontent.com/69080584/119426616-be61e300-bd33-11eb-8790-d8f726980478.mp4
System Information

OS Version: Windows 10 20H2 19042.985
App version: v<IP_ADDRESS>

Additional comment
Does this problem happen again after restarting the app? Yes this problem happens again after restarting the app with the less potential of crash, however it is annoying to copy the large file and suddenly it crashes which causes some file(s) to be corrupted.

Could you check if the same happens if you set gridview layout mode?

Hi @gave92, this method works! However, it works more slower than before, is there an alternative way to solve this issue without using caching? Thanks.

@stanleyowen was turning off caching enough to fix the issue also in details view?
You could try reenabling the caching and to delete the "cache.db" file you can find in the folder where the log files are.

Thanks @gave92, after deleting cache.db and reenabling the caching mode option, the app is no longer crash. I'll close this issue now.


New test framework support

Is the feature request related to a problem
I've been building a new testing framework for .NET and noticed that you've got specialised packages for the existing major test frameworks. Would I or yourselves need to do anything to support my framework?
Describe the solution
New packages for TUnit
My framework can be found here: https://github.com/thomhurst/TUnit

i can take a look
first question is how do i access the current test parameter values from the static context?  the other test frameworks use an async local to give access

i can take a look
first question is how do i access the current test parameter values from the static context? the other test frameworks use an async local to give access

Thanks @SimonCropp . You can access this via:
TestContext.Current!.TestDetails.TestClassArguments

@thomhurst as much a think strong naming adds no value, it will negatively impact the uptake of TUnit

@thomhurst as much a think strong naming adds no value, it will negatively impact the uptake of TUnit

Sorry what do you mean?

tunit is not strong named. most potential consumers will want it to be strong named

Ohhh you mean key signing the assembly/package? Thanks for the heads up. I'll raise an issue on my repo so I don't forget about it :)

this is some nunit code
[TestFixtureSource(nameof(FixtureArgs))]
public class TestFixtureSourceAndTestCaseUsage(string arg1, int arg2)
{
    [TestCase("FromTestCase2")]
    public Task Test(string arg3) =>
        Verify(
            new
            {
                arg1,
                arg2,
                arg3
            });

    static object[] FixtureArgs =
    [
        new object[]
        {
            "Value2",
            2
        }
    ];
}

whats the equivalent in TUnit?

this

    [Test]
    [Arguments((float)1.1)]
    public Task Float(float arg) =>
        Verify(arg);

results in
33>Float_ParametersSample_49363d0d3fb0455cb46335bd8b7587a2.Generated.cs(18,39): Error CS0664 : Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type

if i use
    [Test]
    [Arguments(1.1F)]
    public Task Float(float arg) =>
        Verify(arg);

i get
33>Float_ParametersSample_096a4f03ccd54ee285b352b9f622e9ee.Generated.cs(18,39): Error CS0664 : Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type

whats the equivalent in TUnit?

[MethodDataSource(nameof(FixtureArgs), UnfoldTuple = true)]
public class TestFixtureSourceAndTestCaseUsage(string arg1, int arg2)
{
    [Test]
    [Arguments("FromTestCase2")]
    public Task Test(string arg3) =>
        Verify(
            new
            {
                arg1,
                arg2,
                arg3
            });

    public static (string, int) FixtureArgs() => ("Value", 2);
}

this

    [Test]
    [Arguments((float)1.1)]
    public Task Float(float arg) =>
        Verify(arg);

results in
33>Float_ParametersSample_49363d0d3fb0455cb46335bd8b7587a2.Generated.cs(18,39): Error CS0664 : Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type

if i use
    [Test]
    [Arguments(1.1F)]
    public Task Float(float arg) =>
        Verify(arg);

i get
33>Float_ParametersSample_096a4f03ccd54ee285b352b9f622e9ee.Generated.cs(18,39): Error CS0664 : Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type

Ah nice spot - My bad! Source generator wasn't appending the relevant suffix.
Can you try with version [0.1.738](https://www.nuget.org/packages/TUnit/0.1.738)?

Thanks @SimonCropp ! ❤

@thomhurst no worries. and i good work on TUnit. it was the easiest test framework to integrate with so far


Low quality of CR instance in the latest OHIFViewer version

Hello,
I downloaded the latest version of OHIFViewer and run it as specified here. However, I have a CR that has low quality:

I was using a previous version of OHIFViewer (api version 1.4, from Nov. 2017) and the image is displayed just fine. Maybe something got broken in the latest version?
I'm attaching the anonymized DICOM.
Cheers
Antonio
3e1e0a1d-15e3b12c-5336bd14-a0ce193f-3dc754ab.zip

Hi all,
It seems to be an issue with cornerstoneWADOImageLoader. I opened the DICOM in the online example and this is the result:

I tried the same example but with an older version of cornerstoneWADOImageLoader and the image displayed just fine.
As a workaround in OHIF, I replaced the new version of cornerstoneWADOImageLoader from  Viewers/Packages/ohif-cornerstone/public/js/ with an older version I had locally and ran OHIFViewer again. The image displayed just fine!
Cheers
Antonio


"Uncaught Error: Cannot read property 'signatures' of undefined" in ParameterHintsModel

<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>I have a function
const add = (a: number, b: number): number => a + b;

When I type add( or hit Ctrl+Space inside add(), I would expect to see (a: number, b: number): number pop up. However, it fails inside ParameterHintsModel.prototype.doTrigger on the line
if (!result || !result.value.signatures || result.value.signatures.length === 0) {

When I pause it there, it shows that result exists and result.signatures exists (with the completion item I need!), but there is no result.value. Is this from the 0.18.0 update or am I missing something?

Duplicate of https://github.com/microsoft/monaco-editor/issues/1576


Unable to rejoin cluster after leaving

Required information

Distribution: Ubuntu
Distribution version: 20.04 Focal
The output of "lxc info":  https://paste.ubuntu.com/p/ms9Qmwpgnc/

Kernel version:  5.4.0-14-generic
LXC version:
LXD version:  3.23 (snap 14066)
Storage backend in use:  zfs with existing root zfs pool

Issue description
I had a 3 node cluster (recently built after installing focal), each node has a zfs root filesystem on the rpool zfs pool.  I have created rpool/lxd for lxd's use.  I then realized one machine did not have the correct disk layout and since I deploy with maas I decided to fix it.  I did an lxc cluster remove on that machine no problems it left the cluster leaving me with 2 nodes.  I then rebuilt the 3rd machine but it will not rejoin the cluster, lxd init hangs.  I then tried with another focal machine and I also have problems with it joining, but thought it might be because I had lxd previously configured on that box not in a cluster.  So I tried adding a random VM to the cluster, it joined just fine and I removed it to continue testing on the 2 nodes that I actually want as cluster members.
Steps to reproduce
I have tried to reproduce this on bionic with no such luck.  I am going to spin VMs and try focal shortly I will post the results.
Information to attach
Status before join attempt:  https://pastebin.canonical.com/p/HBJYNtCXRZ/
lxd init --debug output:  https://pastebin.canonical.com/p/p3mTQmFg8D/
lxd debug log from machine attempting to join cluster:  https://pastebin.canonical.com/p/bxGX9CXNpZ/
lxd log from node1 (for appropriate time frame):  https://pastebin.canonical.com/p/gpfcdNMJhr/
lxd log from node2 (for appropriate time frame):  https://pastebin.canonical.com/p/F4B79GJt75/
lxc monitor from node1 (for appropriate time frame): https://pastebin.canonical.com/p/gxm4S8jKFD/
lxc monitor from node2 (for appropriate time frame): https://pastebin.canonical.com/p/WMT2DzsR8v/
status post join attempt: https://pastebin.canonical.com/p/DrFGnDByhF/
I think this is very similar to
https://github.com/lxc/lxd/issues/5896
But the failed to join cluster message from my logs is:
t=2020-03-28T16:37:01-0600 lvl=dbug msg="Failure for task operation: ad6c2061-9881-49dd-82db-cfa286bae2a9: Failed to join cluster: server ID already in use (1)"
hence the new issue.  I'd appreciate any help

@freeekanayaka ideas?

FYI I can't reproduce this with VMs.  I've tried to break it and can't.  I'm thinking the failed operation that failed with "Failed to join cluster: server ID already in use (1)" is coming from dqlite but I'm not sure that's where I need some advice on where to look next.

I tried a hail marry attempt and joined the <IP_ADDRESS> node to the cluster I stood up in VMs, it joined right away.  I then left the cluster removed the snap and all lxd related folders, reinstalled, and it joined the real cluster right away.  Unfortunately the <IP_ADDRESS> node is stuck in the same place the trick didn't work for it.

I tried a hail marry attempt and joined the <IP_ADDRESS> node to the cluster I stood up in VMs, it joined right away. I then left the cluster removed the snap and all lxd related folders, reinstalled, and it joined the real cluster right away.

This is the behavior I'd indeed expect to see for <IP_ADDRESS>, given that <IP_ADDRESS> is not showing up in the raft_nodes table of node2, as you report in https://pastebin.canonical.com/p/HBJYNtCXRZ/.
If I understand correctly (from https://pastebin.canonical.com/p/p3mTQmFg8D/ and https://pastebin.canonical.com/p/p3mTQmFg8D/) you made also at least another attempt to join <IP_ADDRESS> and it failed with server ID already in use (1). Is that correct? That would be quite surprising, and I wouldn't have an explanation for it, even more so if it actually worked at a second attempt.

Unfortunately the <IP_ADDRESS> node is stuck in the same place the trick didn't work for it.

This one failure is expected, since <IP_ADDRESS> does show up in the raft_nodes table of node2, meaning that it's currently already part of the raft configuration.
The question here is how did you and up with <IP_ADDRESS> being in the raft configuration but not in the global nodes table. That might be due to some issue that occurred the very first time you removed <IP_ADDRESS>, do you recall noticing anything like that?
I seem to remember that there were a few issues reported when using LXD clustering with MAAS, because nodes might end up being added and/or removed concurrently and that's probably not something we handle quite well at the moment.
Unfortunately I don't think there's an easy way to recover from this specific situation, the best you could do is to shutdown all the nodes currently part of the cluster, pick one of them, then follow the steps here, and finally force-remove and re-join the remaining nodes.

@freeekanayaka thanks for the help.  This solution sounds drastic to me especially since I have containers running on this cluster, and if I had say 100 nodes in my cluster instead of 3 I would basically have to rebuild the cluster?

That might be due to some issue that occurred the very first time you removed <IP_ADDRESS>, do you recall noticing anything like that?

No, I don't, it seemed pretty straight forward.  Although it is possible in all of my testing/troubleshooting of this I made things worse.

I seem to remember that there were a few issues reported when using LXD clustering with MAAS, because nodes might end up being added and/or removed concurrently and that's probably not something we handle quite well at the moment.

Good to know.  I'm using MAAS only to deploy the machines.  Currently, I am clustering lxd by hand so I likely to them serially, although again I've been doing a lot of troubleshooting, it's possible I was building the .40 system and coincidentally ended up doing them concurrently but I'll keep this in mind.
It sounds like the best course of action is to essentially follow the disaster recovery procedures and rebuild my cluster.  My question is if I have running containers across the nodes, how will those be impacted.  If I remove all of the nodes from the cluster and re-add them AIUI the containers that were on that node will no longer exist.  Is that correct?  Would something like LXD import help me here?  Would I be better off to stop the running containers, move them all to say node2, run the recover from quorum lost on that node, then remove and re-add the other nodes, migrating containers back as I add them?  @stgraber thoughts?

@freeekanayaka thanks for the help. This solution sounds drastic to me especially since I have containers running on this cluster, and if I had say 100 nodes in my cluster instead of 3 I would basically have to rebuild the cluster?

This disaster recovery sequence was not meant for this particular situation. But yes, I agree we might need to improve it so it can handle also situations like this more easily.
I'd say the first thing though would be to understand how the problem occurred. Probably we'd need to run more serious QA around clustering+MAAS, since afaik it's a scenario we don't exercise much or hear much about from users.

I'd say the first thing though would be to understand how the problem occurred. Probably we'd need to run more serious QA around clustering+MAAS, since afaik it's a scenario we don't exercise much or hear much about from users.

I would say the most likely scenario here is I accidentally tried to add .31 and .40 at the same time.  I can't say for sure as I've been doing a lot of troubleshooting, luckily this is my lab and it's been a good lxd troubleshooting learning experience for me.  I would say I doubt this has anything to do with MAAS as I am using MAAS only to deploy the OS then by hand I'm installing lxd and clustering.  Although I can see how this would be an issue if it were part of my automation.  Which I will have to figure out something in my automation to handle the concurrent joins, but I'll figure something out.

I would say the most likely scenario here is I accidentally tried to add .31 and .40 at the same time.

If you have time to test concurrent joins and check if you can confirm the issue can be in fact triggered that way, we might try to see if there's something reasonable we can do on our side to fix this.

Ok I moved all of the containers to node2.  I then stopped lxd, and verified it was down with ps | grep lx nothing returned.  When I try to run recover-from-quorum-loss I get:
root@node2:~# lxd cluster recover-from-quorum-loss
Error: The LXD daemon is running, please stop it first.

Debug output: https://pastebin.canonical.com/p/ZxKCTbkhPb/
Logs: https://pastebin.canonical.com/p/VttzTrhrGC/

@freeekanayaka ah yeah, concurrent joins is something we should definitely test and if broken, fix.
I didn't see this failing much in the past when creating a 50 nodes cluster with all nodes installing around the same time, but it may just have been luck.

Ok I moved all of the containers to node2. I then stopped lxd, and verified it was down with ps | grep lx nothing returned. When I try to run recover-from-quorum-loss I get:
root@node2:~# lxd cluster recover-from-quorum-loss
Error: The LXD daemon is running, please stop it first.

Debug output: https://pastebin.canonical.com/p/ZxKCTbkhPb/

This debug output shows that lxd cluster recover-from-quorum-loss is able to connect to the LXD daemon process via Unix socket and the process sends back a reply.
You probably still have socket activation via systemd turned on, so even if the process is not running when you launch the command, it will be started as soon as you connect to the Unix socket.
Please try:
sudo systemctl stop snap.lxd.daemon.service
sudo systemctl stop snap.lxd.daemon.unix.socket

@freeekanayaka thanks I didn't see the socket.  The recover-from-quorum-loss procedure worked.  I think we are good to close this issue thanks for your help.


[Question] Filter out noise from video calls with client-sdk-js

Hi,
I am using client-sdk-js to create a complete client app. In my plan, I need feature of filter out noise from video calls but I can't find it in client-sdk-js. Do you have that feature? If not, have you put it in your roadmap?
Thanks!

Now I'm adding some options for createLocalAudioTrack method but I have no idea what's it mean and how that params work between client and livekit server. Can you explain more about it?
My example code below:
const audioTrack = await createLocalAudioTrack({
echoCancellation: true,
noiseSuppression: {
ideal: true,
}
})
const audioPublication = await room.localParticipant.publishTrack(audioTrack)

These are webrtc settings that LiveKit would pass through. For more see: https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/noiseSuppression
setting them simply as true will suffice