Automatic update/remove associated relationship

Hello,
I'm here to get some information about using EntityFramework core for relationship management.
Indeed, let's take the example with the following models.
A first entity "Dashboard":
public class DashboardEntity
{
    [Key]
    public int Id {get; set; }

    [Required]
    public string Name {get; set; }

    public IEnumerable <DashboardIndicatorRelationEntity> Indicators {get; set; }
}

A second entity "Indicator":
public class IndicatorEntity
{
    public int Id {get; set; }

    [Required]
    public string Name {get; set; }

    public IEnumerable <DashboardIndicatorRelationEntity> Dashboards {get; set; }
}

And an entity for the relationship:
public class DashboardIndicatorRelationEntity
{
    [Required]
    public int DashboardId {get; set; }

    [Required]
    public int IndicatorId {get; set; }

    public DashboardEntity Dashboard {get; set; }

    public IndicatorEntity Indicator {get; set; }
}

Here is the configuration of the relationship in the Fluent API:
builder.HasKey (di => new {di.IndicatorId, di.DashboardId});

builder.HasOne (di => di.Indicator)
    .WithMany (i => i.Dashboards)
    .HasForeignKey (di => di.IndicatorId);

builder.HasOne (di => di.Dashboard)
    .WithMany (d => d.Indicators)
    .HasForeignKey (di => di.DashboardId);

When creating a new Dashboard with indicators associated with the creation, I do not have any problem.
For example :
_context.DashboardEntity.Add (dashboard);
await _context.SaveChangesAsync ();

Entity adds in database the new Dashbord with the indicators, so it manages the relationship automatically when adding.
On the other hand, I encounter more problem when updating the entity and the deletion of relations.
Let's take the example where I already have a single Dashboard in database which therefore has an ID = 1 and two Indicator (Indicator 1 and Indicator 2). Only Indicator 1 is associated with Dashboard 1.
If I want to update the Dashboard's relations by adding the Indicator 2 and deleting the old relation with the Indicator 1, I proceed as follows:
var updateDashboard = new DashboardEntity
{
    Id = 1,
    Name = "Dashboard Name",
    Indicators = new DashboardIndicatorRelationEntity () {
        IndicatorId = 2
    }
};

_context.Entry (updateDashboard) .State = EntityState.Modified;
await _context.SaveChangesAsync ();

This does not work, the new relationship with Indicator 2 is well added, but the old relation with Indicator 1 is always present.
I tried with an Update:
_context.DashboardEntity.Update (updateDashboard);
await _context.SaveChangesAsync ();

But there is no difference, the result is the same.
I managed to work around the problem by removing the relationship manually with Remove:
var dashboard = _context.DashboardEntity.FindAsync (updateDashboard.id);
var indicator = new DashboardIndicatorRelationEntity {DashboardId = 1, IndicatorId = 1};
dashboard.Indicators.Remove (indicator);
await _context.SaveChangesAsync ();

Which is not very practical ... Because it forces to juggle with the remove and the update to update the relations of an entity.
Do you have a more suitable solution to manage changes (addition, deletion) automatically when updating an entity that has related relationships?
Thank you.
Technical details
EF Core version: Microsoft.AspNetCore.App : 2.1.5
Database Provider: Pomelo.EntityFrameworkCore.MySql : 2.1.2
Operating system: Ubuntu 18.04
IDE: Visual Studio Code

@aborderon In a many-to-many relationship such as this, adding a new relationship between the two entities does not remove an existing relationship; that's basically the point of a many-to-many relationship. Can you explain a bit more why in this case you expect an existing relationship to be removed when a new relationship is added?

EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.


run-pixelweb fails to launch

run-pixelweb has an error expressed here:
Traceback (most recent call last):
  File "/usr/local/bin/run-pixelweb", line 3, in <module>
    from pixelweb.pixelweb import startServer
  File "/usr/local/lib/python2.7/dist-packages/pixelweb/pixelweb.py", line 8, in <module>
    from actions import *
  File "/usr/local/lib/python2.7/dist-packages/pixelweb/actions.py", line 10, in <module>
    from bpmanager import *
  File "/usr/local/lib/python2.7/dist-packages/pixelweb/bpmanager.py", line 4, in <module>
    from static_objects import *
  File "/usr/local/lib/python2.7/dist-packages/pixelweb/static_objects.py", line 35, in <module>
    moduleList.remove(None)
ValueError: list.remove(x): x not in list```

A hacked work-around is just to delete line 35 from https://pypi.python.org/simple/bibliopixel/:
moduleList.remove(None)

Then launching run-pixelweb at least succeeds, although I don't really know if that line was essential for some other part of the initialization process. Sorry for spamming you with issues!

Fixed in 36bd3ec69e1e4cff89d4a6be7def8fc2c40f31e0
Looks like you are running on a Pi... I was expecting some drivers not to load, causing None in the moduleList. I now check for None before trying to remove. Should work fine now.
Also... way to be on the cutting edge :) Haven't technically announced this yet. Monday!

Yes, it's a pi, and it's actually a fluke, I was looking to see if the bibliopixel repo had been updated (I had just fetched the tgz and didn't do the pip install or git clone earlier) and saw this, so fun, it looks great! Still a bit rough (my queue hasn't been advancing) but my cube is now much more hallween-esque for trick-or-treating this afternoon than it was an hour ago, with very little work, so awesome!

Your animations in the queue have to implement animComplete or you have to
set max frames. Watch this: https://youtu.be/WGmNFANYjck
On Oct 30, 2015 5:08 PM, "praeluceo"<EMAIL_ADDRESS>wrote:

Yes, it's a pi, and it's actually a fluke, I was looking to see if the
bibliopixel repo had been updated (I had just fetched the tgz and didn't do
the pip install or git clone earlier) and saw this, so fun, it looks great!
Still a bit rough (my queue hasn't been advancing) but my cube is now much
more hallween-esque for trick-or-treating this afternoon than it was an
hour ago, with very little work, so awesome!
—
Reply to this email directly or view it on GitHub
https://github.com/ManiacalLabs/PixelWeb/issues/2#issuecomment-152652048
.


Kernel boot param tweaks for tegra186

I'm not sure about these changes.   In my testing on my Jetson-TX2, U-Boot sets the ${devnum} variable appropriately when it scans for the extlinux.conf file on the SDcard, and the kernel is able to mount the SDcard just fine.
Can you explain more about the problem you're trying to solve here?

I use U-Boot 2016.07-g5971907 and in my testing on my Jetson-TX2, it doesn't, so the system doesn't boot from sd card.

I had to implement this fix as well.

Have you modified your kernel configuration to disable CONFIG_DEVTMPFS_MOUNT?   Because that is set in the defconfig provided in the layer, so the extra parameter should be redundant.
And if you're booting via the extlinux.conf file, U-Boot should be setting ${devnum}.  My U-Boot is also 2016.07-g5971907, the stock NVIDIA L4T R27.1 version.
A log of the serial console showing the problem might help.


State machine and Android lifecycle

I tried to tie state machine to Android lifecycle:

sm.stop() called at onStop() lifecycle callback

consideration 1: events are not handled when activity is in background

sm.destroy() called at onDestroy() lifecycle callback

consideration: object/singleton events are released and can be reused

But failed because stop() causes that DestroyEvent is not handled. And it is not clear,
how can I call only destroy() without stop() if they bound to callbacks.
I know about stop parameter in destroy() but it is useless it in my case.
Any thoughts? May be I misuse these calls?

A small change can help
    override suspend fun processEvent(event: Event, argument: Any?): ProcessingResult {
        return coroutineAbstraction.withContext {
            checkNotDestroyed()
            check(isRunning || **event is DestroyEvent**) { "$this is not started, call start() first" }

Hi! The fact that you cannot effectively call destroy() on stopped StateMachine is a bug.
It was possible on older library versions but it was broken when I moved destroy() method to event-processing mechanism. And missed such case.
As a workaround you can try using start() + destroy() combination in Activity::onDestroy().
I will check how I can fix this and make destroy() working on stopped StateMachine.
Thank You!

consideration: object/singleton events are released and can be reused

I suppose you meant States (not Events)

Actually, in your usecase you don't have to use destroy() in Activity::onDestroy().
As createStateMachine() has autoDestroyOnStatesReuse argument. But looks it is broken for the same reason, as implemented throw same destroy() call.

Ha! This might be the reason as well

fixed https://github.com/nsk90/kstatemachine/releases/tag/v0.24.1


Use the configuration specified in application.conf

The Conf object issued by ConfigFactory.load() must be fed to the constructor of the actor system in order to use the settings specified in the application.conf file.

Looks good to me. Waiting for build to pass. Free orange juice for anyone able to explain to me why it seemed to work well without this change.


Does not check for index.vue files

Hi! It seems the tool currently checks if an index.js(x) file exists at a given path but not for an equivalent .vue file. is this by design? we have a convention to have filepaths like so:

Components/Data/DataTable/index.vue

where the tool fails with:

Neither 'Components/Data/DataTable.vue' nor 'Components/Data/DataTable.js(x)' or 'Components/Data/DataTable/index.js(x)' or 'Components/Data/DataTable/index.ts(x)' could be found in 'Frontend/Components/Data'

is this something that can be fixed/added in the forseable future?
cheers,
daniel

Hi Daniel! 👋🏻
I looked into this issue but I'm struggling to reproduce it. When I add an import using an index.vue file it is resolved correctly. From the error message it might be that something else is not configured correctly. I'm wondering if you specified Components as alias in your project? Or how exactly do your imports / folder structure look like? If you use aliases do you pass the webpack config to vuensight? If you don't use webpack but another bundler and aliases, I'm afraid you'd have to pass a fake webpack config to make this work.


[10.x] Fix Http::async() calls running in sequence instead of concurrently

Since Laravel 9 PendingRequest.buildClient() no longer calls PendingRequest.getReusableClient() to reuse the same GuzzleHttp Client across async requests.

Laravel 8: PendingRequest.buildClient()
Laravel 9: PendingRequest.buildClient()

Sample code to reproduce the bug:
use Illuminate\Support\Facades\Http;
use GuzzleHttp\Promise\Utils;

$client = Http::async();

$promises = [
    $client->get('https://postman-echo.com/delay/3'),
    $client->get('https://postman-echo.com/delay/3'),
];
$combinedPromise = Utils::all($promises);

$results = $combinedPromise->wait();

In Laravel 8 this code runs for ~3 sec (requests run concurrently). In Laravel 9 and 10 this code runs for ~6 sec (requests run sequentially). This PR fixes the bug and brings the execution time back to ~ 3 sec (requests run concurrently again).
This PR uses PendingRequest.getReusableClient() again to ensure that async HTTP requests reuse the GuzzleHttp Client to run requests concurrently instead of sequentially.

This looks like a breaking change.
Following the documentation my requests run concurrently: https://laravel.com/docs/10.x/http-client#concurrent-requests

The reason that I am not using Http::pool is that for some reason it ignores any exceptions that I am throwing in the then() statement:
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\Pool;

$responses = Http::pool(fn(Pool $pool) => [
    $pool->get('https://postman-echo.com/delay/3')->then(function ($response) {
        if ($response->status() == 200) {
           throw new Exception(); // This exception is being ignored by the Global Exception Handler
        }
    }),
    $pool->get('https://postman-echo.com/delay/3'),
]);

The Exceptions are not being ignored when using Http::async():
use Illuminate\Support\Facades\Http;
use GuzzleHttp\Promise\Utils;

$client = Http::async();

$promises = [
    $client->get('https://postman-echo.com/delay/3')->then(function ($response) {
        if ($response->status() == 200) {
           throw new Exception(); // This exception is NOT ignored by the Global Exception Handler
        }
    }),
    $client->get('https://postman-echo.com/delay/3'),
];
$combinedPromise = Utils::all($promises);

$results = $combinedPromise->wait();

The reason that I am not using Http::pool is that for some reason it ignores any exceptions that I am throwing in the then() statement:
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\Pool;

$responses = Http::pool(fn(Pool $pool) => [
    $pool->get('https://postman-echo.com/delay/3')->then(function ($response) {
        if ($response->status() == 200) {
           throw new Exception(); // This exception is being ignored by the Global Exception Handler
        }
    }),
    $pool->get('https://postman-echo.com/delay/3'),
]);

The Exceptions are not being ignored when using Http::async():
use Illuminate\Support\Facades\Http;
use GuzzleHttp\Promise\Utils;

$client = Http::async();

$promises = [
    $client->get('https://postman-echo.com/delay/3')->then(function ($response) {
        if ($response->status() == 200) {
           throw new Exception(); // This exception is NOT ignored by the Global Exception Handler
        }
    }),
    $client->get('https://postman-echo.com/delay/3'),
];
$combinedPromise = Utils::all($promises);

$results = $combinedPromise->wait();

Why was this closed ?
Does this mean that there is no other way to do concurrent requests without the use of Http::pool ?


Rename LICENCE.txt to LICENCE

Why? If I merge this, I cannot double-click the file in Windows and open it directly.

Oh okay, if you merge it then it will show your licence in your github repo on top.

It already shows the license at the top without the need of renaming, have a more careful look ;-)

Cool, just saw it, I think it was not showing before.

It was definitely showing before.


How to use this lib?

I want to create an ChromiumWebview to alertnative DefaultWebview.
how can I do that? any document?

I found the Demo.
just use AwSheelApplication and AwShellActivity.

I found the Demo.
just use AwSheelApplication and AwShellActivity.

I need use SharedArrayBuffer.
Who can I enable  CrossOriginOpenerPolicyReporting?
I tried:
CommandLine.init(
            arrayOf(
                "android_webview",
                "--cross-origin-opener-policy-reporting=enabled",
                "--cross-origin-isolated=enabled",
                "--cross-origin-opener-policy-access-reporting=enabled",
                "--enable-blink-features=CrossOriginOpenerPolicyReporting"
            )
        )

But I do not work.

I need use SharedArrayBuffer.
Who can I enable  CrossOriginOpenerPolicyReporting?
I tried:
CommandLine.init(
            arrayOf(
                "android_webview",
                "--cross-origin-opener-policy-reporting=enabled",
                "--cross-origin-isolated=enabled",
                "--cross-origin-opener-policy-access-reporting=enabled",
                "--enable-blink-features=CrossOriginOpenerPolicyReporting"
            )
        )

But I do not work.


kubectl and descheduler CPU utilisation values are vastly different

We've notice that the values for CPU utilisation between kubectl top nodes and the descheduler are vastly different.
I0423 10:01:19.375155    7053 lownodeutilization.go:156] Node "XXX" is appropriately utilized with usage: api.ResourceThresholds{"cpu":44.05815423514539, "memory":38.10868466231932, "pods":18.96551724137931}

while kubectl top nodes reports
NAME                                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
XXX    7946m        100%   10365Mi         81%

The values are vastly different and the ones reported by kubectl seem to be the ones that match the node usage. Is there any reason why the 2 values will missmatch so much?

/close
@duronrulez currently the LowNodeUtilization descheduler strategy uses container requests not the actual CPU and memory utilization. Yes, the word utilization is in the name of the strategy, and this is confusing. There is a one liner in the README that describes this, Currently, pods request resource requirements are considered for computing node resource utilization..
See #7 for a discussion around utilization vs allocation terminology confusion. See #225 for a discussion on adding a new strategy that is based on actual container utilization metrics.

/kind feature


Allow tools method to receive the @MemoryId object

@cescoffier do you have an example of something that would use this?

I do not have an example. It is just the consequences of the change in langchain4j

Understood, thanks

Good point, thanks!


runtime: linux/s390x ThreadSanitizer failed to allocate 0x7e0000 (8257536) bytes at address<PHONE_NUMBER>00 (errno: 12) in QEMU

Go version
go version go1.22.3 linux/amd64
Output of go env in your module/workspace:
GOARCH=s390x

What did you do?
Cross-compiled a race build test binary from linux/amd64 to linux/s390x:
      - name: 'BuildTestRace with ${{ matrix.go }} for ${{ matrix.arch }}'
        if: ${{ matrix.arch == 'aarch64' && !matrix.arm64_race_unsupported || matrix.arch == 's390x' && !matrix.s390x_race_unsupported }}
        env:
          CGO_ENABLED: 1
        shell: bash
        run: |
          set -euxo pipefail

          # Non-host *.syso files are missing from the Go toolchains provided
          # by setup-go. See https://github.com/actions/setup-go/issues/181.
          curl --location --output "$(go env GOROOT)"/src/runtime/race/race_linux_"$GOARCH".syso \
            https://github.com/golang/go/raw/release-branch.go${{ matrix.go }}/src/runtime/race/race_linux_"$GOARCH".syso

          sudo apt update
          sudo apt install -y gcc-${{ matrix.arch }}-linux-gnu

          CC=${{ matrix.arch }}-linux-gnu-gcc CC_FOR_TARGET=gcc-${{ matrix.arch }}-linux-gnu go test -c -race -o goid.race.test ./...

where GOARCH=s390x and ${{ matrix.arch }} == s390x, and then attempted to run that binary using docker-on-qemu:
      - name: 'Test and Bench with ${{ matrix.go }} on ${{ matrix.arch }}'
        if: ${{ matrix.arch != '386' && matrix.arch != 'x64' && !matrix.qemu_emulation_broken }}
        uses: uraimo/run-on-arch-action@v2
        with:
          arch: ${{ matrix.arch }}
          distro: bookworm
          dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly
          shell: /bin/bash
          run: |
            set -euxo pipefail

            find /checkout -name '*.test' -type f -executable -print0 | \
              xargs -t -0 -I '{}' sh -c '{} -test.v && {} -test.bench=. -test.benchmem -test.v'

What did you see happen?
+ find /checkout -name '*.test' -type f -executable -print0
  + xargs -t -0 -I '{}' sh -c '{} -test.v && {} -test.bench=. -test.benchmem -test.v'
  sh -c '/checkout/goid.race.test -test.v && /checkout/goid.race.test -test.bench=. -test.benchmem -test.v'
  ==17==ERROR: ThreadSanitizer failed to allocate 0x7f0000 (8323072) bytes at address 9000001a0000 (errno: 12)
  sh -c '/checkout/goid.test -test.v && /checkout/goid.test -test.bench=. -test.benchmem -test.v'
  === RUN   TestGet
  --- PASS: TestGet (0.01s)
  PASS
  === RUN   TestGet
  --- PASS: TestGet (0.01s)
  goos: linux
  goarch: s390x
  pkg: github.com/petermattis/goid
  cpu: AMD EPYC 7763 64-Core Processor @ 3242.4[67](https://github.com/petermattis/goid/actions/runs/9417707064/job/25943521220?pr=44#step:16:68)MHz
  BenchmarkGet
  BenchmarkGet-4   	130759052	         9.021 ns/op	       0 B/op	       0 allocs/op
  PASS
  Error: The process '/home/runner/work/_actions/uraimo/run-on-arch-action/v2/src/run-on-arch.sh' failed with exit code 123

What did you expect to see?
I expected the test to pass.

This was observed in https://github.com/petermattis/goid/actions/runs/9417811829 in all Go versions between 1.19 (when race supported was added) and 1.22 (latest at the time of writing).

-race does use a lot more memory, maybe you are just running out. How much memory is it using when it fails? How much memory does the test use at peak without -race?

Is this a qemu issue only or is that reproducible on a s390x machine? We don't have qemu as an official platform that Go supports, support for it has always being best-effort. I myself have experienced some failures in the past that were confirmed false positives when testing with one of our s390x builders.

cc @iii-i who contributed race support for s390x in https://github.com/golang/go/commit/87cf92e7d51aea29eae0266b6d65e1a5b6244131.

My suspicion is that the racefuncenter call is clobbering the g register somehow, causing the getg hack to return junk.

CC @golang/s390x

Similar Issues

https://github.com/golang/go/issues/58783
https://github.com/golang/go/issues/58785
https://github.com/golang/go/issues/64650
https://github.com/golang/go/issues/33514
https://github.com/golang/go/issues/21460

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)


Beginning of on-chain (quasimodo calling) functionality for EBBO

This does not rely on CoW API endpoint, except for fetching order_id and auction_id.
Initially here, is the draft/first version of the main code, which will be used via an onchain_daemon file.
main() here will get deleted, but it is currently there to run the file easily.
to run:
comment out the part that assumes a call to quasimodo has been made.
from the ebbo directory: python -m src.on_chain.on_chain_surplus

Would be good to add more comments throughout the code so that it's easier to read/understand.

Have to admit mypy with the strict flag is indeed strict so might take a bit to fix all type errors/warnings.

Merging this.... Will definitely revisit to do a clean up. But for now, fingers crossed.....


Adding testing as github action

Adds a github action to run_tests.

Is this ready for review and merge @joshua-cogliati-inl ?

Is this ready for review and merge @joshua-cogliati-inl ?

Yes, I am done with it unless the review sees something that needs fixing.


[FLINK-29812][rest] Remove deprecated Netty API usages

@XComp Should be covering everything now.

HttpHeaderNames.Values is still used in HttpTestClient


Autocorrect align end to if is misaligned

running rubocop on this file with auto-correct
a = if x == 1
      "A"
    elsif x == 2
      "B"
    else
      nil
    end

results in
a = if x == 1
      "A"
    elsif x == 2
      "B"
        end

Running it again will not align the end
test.rb:5:9: W: end at 5, 8 is not aligned with if at 1, 4.
        end
        ^^^

Style/EmptyElse messes up the indentation of end. Then Lint/EndAlignment doesn't fix it, because auto-correct is disabled by default for that cop (see for example #2719). I think this should be fixed in Style/EmptyElse.

I agree with @jonas054, this should be fixed in Style/EmptyElse. I think I know what the issue is, and this should be easy to fix. I will try to find some time to knock this out.


Update for Xcode 8 beta 6

Any chance we can get an update for the latest beta? There are some changes in the Swift 3 compiler

Happy to accept PRs

Done in #106.


Coap Request response not received on client end

I am using Nordic's SDK for openthread and Zigbee v4.0.0  on nrf52840 platform.
In openthread coap client server model, I have created a bootstrap resource.
When client hit on that bootstrap resource, the request is received by server.
I am using otCoapSendResponse api to send the response back but the response is not  received on client end.
After sending the response, application reboots.

@bhumikaajain , we need more information to help diagnose. Are you able to share the code you are using?
You can also refer to src/cli/cli_coap.cpp, which provides a demonstration of using CoAP APIs.

Closing stale issue.


Eliminate references to type annotation in compile_ptx

Eliminate use of type annotation when referencing filenumber and line number of a python function. This issue partially addresses issue 7710

gpuci run tests

gpuci run tests


Update oracle adapter docs

What are you changing in this pull request and why?
This PR updates oracle adapter docs:

Simpler installation and configuration using the thin driver
Integration with conda environment manager for dbt Python models
Oracle Specific Configuration updates

Checklist

[x] Review the Content style guide so my content adheres to these guidelines.
[x] For docs versioning, review how to version a whole page and version a block of content.

Thanks @mirnawong1 for reviewing the docs and fixing the typos. This looks good.