[Docs] Documentation lacks dependencies

Bug, feature request, or proposal:
Why does every single example encourages to use a MODULE that imports ALL OTHER MODULES?
This is not only technically a bad practice, but also visually. Come on.
The problems start when a developer wants to import and use only ONE module.
How should I know that for working with MatDatePicker I also need to import MatInput (even if that's not used directly in template)? This info is not mentioned anywhere! How many surprises like that awaits me in future?

You're welcome to submit a PR with proposed changes to the documentation.

@radzik07 MatDatepicker doesn't actually have a dependency on MatInputModule. You can place a datepicker on a native input if you wish. It is only the examples using matInput that have that dependency.
To answer your first question, there is a default template that the docs site uses to construct a Plunker example. Presumably to avoid a bunch of configuration for individual examples, that template uses a generic PlunkerMaterialModule that exports (and the PlunkerAppModule imports) everything that an example could need.
While it's probably cumbersome to configure each example's NgModule to only use the exact modules needed, it's not outside of reason. Is that what you're proposing? Or do you have any ideas for improving the docs in a way that would have prevented your frustration?

Closing this issue as it does not follow the issue template. Please file a new issue that follows the template, which gives the team the information needed to investigate.


Only depends on components

onlyDependOnComponents

Q
A

New Feature
yes

RFC
no

BC Break
no

Summary
Some classes should ONLY depends on others components.
For example, i have this situation to validate...

Filters
   Appliers : the filtering logic
      StockModel
      StockSku
   Shared : all logic that allow filters work

StockModel &  StockSku should only have 2 files that

Has a suffix of   Applier and DTO
Depends ONLY to the Shared classes

Is it possible to do with the rules already written?
If not, do you think is a possible new good feature?
Thank you so much!

Hi @alessandro-candon,
thanks for this issue, it's very interesting what you want to achieve.

At the moment we don't have the rule to specify if it's inside a class there is a specific number of files or more than one suffix
for this rule I usually use DependsOnlyOnTheseNamespaces but I think that in your example we need more than that right?

I think that we need to implement something, we can try to write an example of a config file to achieve the rules that you want @alessandro-candon
After that, we can try to implement what is necessary.
@fain182 @micheleorselli @pfazzi any different suggestions?

I think, as you say, it's complex than I thought.
I try to write a rule that can explain what we need :
$try = Architecture::withComponents()
    ->component('FilterApplier')->definedBy('App\Filters\Appliers\**\**\*FilterApplier')
    ->component('FilterDto')->definedBy('App\Filters\Appliers\**\**\*FilterDto')
    ->component('FilterShared')->definedBy('App\Filters\Shared\*')
    ->where('FilterApplier')->onlyDependOnComponents('FilterDto', 'FilterShared')
    ->rules();

So, maybe what we need is

support definedBy with regex
introduce onlyDependOnComponents to block every type of dependency with other classes...

An other possibility is to introduce AND OR operator in this way you define some rules that exists at the same time...

It could be a good idea...
Just to understand you better @alessandro-candon which is the problem that made you think "I need to check this DTO/Applier achitecture"? Did you find some Applier which depended on each other? Did you find an Applier without a DTO? Or some other bug?

First of all the naming convention for me is mandatory to be respected... we find a lot of "errors" on that (typo and superficiality)... And if it is possible is very interesting also to have a "dependency" validation, we find some DTOs that depends on service that is not allowed...

So if I understood well, we need:

onlyDependOnComponents rule
definedBy  with regexp

Without using components there is the possibility already to say that a namespace depends only on a specific namespace and we have filters with regexp

@alessandro-candon in this PR #278 I am trying to add the shouldOnlyDependOnComponents that can solve your problem maybe. What do you think?

@alessandro-candon we released version 0.2.28 with the new architectural filter.
Can you please give us feedback about your problem?
Then we can understand together what could be the next step

Hi @AlessandroMinoccheri,
I'm really sorry about my response delay... I'll introduce the filter and try if it is enough!
For the moment thank you so much for your grate work!

No problem for the delay @alessandro-candon!
Let me know if we can do something for your project, at the moment I keep the issue open and I am waiting for your feedback :)


Failed to execute default web browser

Okay I am running Polybar on Arch.  I am using a custom mail module
[module/mail]
type = custom/script
interval = 30
format = <label>
format-prefix = ""
label-padding = 1
exec = $HOME/.config/polybar/mail
click-left = exo-open --launch WebBrowser https://mail.google.com/mail/u/0/#inbox &
click-right = exo-open --launch WebBrowser https://mail.protonmail.com/login &
format-padding = 5

This is the script:
#!/usr/bin/python

import imaplib
obj = imaplib.IMAP4_SSL('imap.gmail.com',993)
obj.login('gmail user','password') # write your email and password
obj.select()
print(len(obj.search(None, 'UnSeen')[1][0].split()))

Qutebrowser is my default browser and is set in exo-preferred as default also.  When clicking either left or right the browser opens to the correct page, either Gmail or Protonmail but I get an error prompt.

This only happens with Qutebrowser not Firefox so I'm not 100% this is even a Polybar issue.

Hmm. But executing exo-open --launch WebBrowser https://mail.google.com/mail/u/0/#inbox and the other one in the terminal works fine with both browsers?
Can you try to replace those two lines with the following ones and report back if that fixes it:
click-left = exo-open --launch WebBrowser https://mail.google.com/mail/u/0/#inbox >/dev/null 2>&1 &
click-right = exo-open --launch WebBrowser https://mail.protonmail.com/login >/dev/null 2>&1 &

But executing exo-open --launch WebBrowser https://mail.google.com/mail/u/0/#inbox and the other one in the terminal works fine with both browsers?

Changing to your suggestion fixed the issue.  Thanks for the tip.

Seems like you are suffering from the same bug as this, reported in #916. Gonna mark this as a duplicate
Has been on my TODO list for the longest time, just need to find some free time to fix it.

Duplicate of #916


Network sync refactoring (part 4)

Another step towards https://github.com/paritytech/substrate/issues/8686
What is achieved here:

sc-network depends only on sc-network-common
sc-network-light depends only on sc-network-common
sc-network-sync depends only on sc-network-common
sc-service depends on all of above to instantiate concrete implementations and compose them back together

Design choices:

common data structures related to networking moved into sc-network-common
new ChainSync trait based on existing ChainSync struct was introduced in sc-network-common (identical in terms of API right now) and sc-network depends on it now instead of concrete implementation
in order to decouple and make sc-network unaware of specific protobuf data structures Opaque[Block|State][Request|Response] were introduced that are converted to/from concrete types in concrete ChainSync implementation, the main drawback of which is additional Boxing and use of Any
network configuration now has a factory function property that must instantiate something implementing ChainSync trait (I didn't expose it from sc-service upward in this PR)

Reviewing commit by commit should make more sense than looking at the final diff.
This needs more careful review comparing to previous refactoring and ideally some benching or test deployment to ensure there is no significant performance regression due to the changes made here.
Polkadot address: 1vSxzbyz2cJREAuVWjhXUT1ds8vBzoxn2w4asNpusQKwjJd

I'll prepare companions once I get general feedback on this one

I'd appreciate some eyes on this to move forward before there are merge conflicts with master that would be hard to resolve due to the depth of changes here.

Just resolved new merge conflicts.
Friendly ping here again :wave:

Looks good, except the whole business with OpaqueStateRequest, OpaqueStateResponse, OpaqueBlockRequest and OpaqueBlockResponse.  I'd suggest changing them to be Vec<u8> or wrappers around Vec<u8> and only expose encoded versions outside of the sync crate. finished_state_requests and finished_block_requests would hold encoded versions and decoding would happen in on_state_response.

I went with that approach to keep current flow of the code. Since we receive some unchecked response bytes from the network, we'd like to know if they are correct at all right away and disconnect from the peer:
https://github.com/paritytech/substrate/blob/a91cd0297235ad2e2ad8669c83a5f241d155f9f4/client/network/src/protocol.rs#L1369-L1384
We can do that and still store vectors, but that'll mean we need to decode it again a few moments later. That felt unnecessary, so I introduced an opaque transport container that can hold quite literally anything as long as it we can use it in the correct place (like ability to turn block response into a list of blocks with block_response_into_blocks).

I'm not sure what "checking" the message right away achieves. It is trivial to compose a junk message that will decode correctly and pass the check anyway.

I mean reporting peer and disconnecting better done sooner rather than later after doing even more work

I mean reporting peer and disconnecting better done sooner rather than later after doing even more work

Sure, it is a bit of an optimizations. However it does not make sense from the security perspective, as it is trivial for a potential attacked to flood with messages which have correct packet structure, but invalid block data. That's what the reputation system is for. As an optimization it only helps a bit with an odd case of a badly implemented peer.
I don't have a stroing opinion for removing it though.

Another use case for that is that I'm planning to have a custom ChainSync impl in our protocol where messages will be different on the wire with more data in them, which will mean I'll likely have to de-serialize it 3 times if it is not stored in de-serialized form right away.

Resolved new merge conflict in lock file.
Is there anything in my power to help this thing move forward?

@nazar-pc can you please merge master?

/tip big

/tip large

@bkchr merged, there were some small conflicts after #11094 was merged due to some functions moving around. GitHub's diff actually appears to not render correctly, function wasn't inserted in the middle of the comment :thinking:

bot merge


Error when creating/building installer for linux (ubuntu 16.04)

When running npm run desktop -- build-installer [ddp_url], below is the error:
...
Packaging for platform linux x64 using electron 1.4.4 to .desktop-installer/linux-unpacked
Unhandled rejection Error: Exit code: ENOENT. spawn icns2png ENOENT
at /home/user/myMeteorApp/node_modules/electron-builder/src/util/util.ts:102:16
at exithandler (child_process.js:220:5)
at ChildProcess.errorhandler (child_process.js:232:5)
at emitOne (events.js:77:13)
at ChildProcess.emit (events.js:169:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
From previous event:
...
ERROR  installerBuilder:  error while building installer:  [Error: Exit code: ENOENT. spawn icns2png ENOENT]
However, its fine when only packaging for linux (npm run desktop -- package [ddp_url]).

sudo apt-get install icnsutils

You have to add linux property in builderOptions in settings.json and conform to these requirements https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux.
I am interested if somebody could prepare a default linux config for the default settings.json in current scaffold as this is absent currently.

I will add some notes about it in the docs.

Thanks for the replies.
After following this link (https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux), below is the error:
ERROR  installerBuilder:  error while building installer:  [Error: Exit code: 1. Command failed: gm convert -size 96x96 /tmp/electron-builder-1107-15860e9a7dc-0/t-1107-1-electron-builder-linux.iconset/icon_256x256x32.png -resize 96x96 /tmp/electron-builder-1107-15860e9a7dc-0/t-1107-1-electron-builder-linux.iconset/icon_96x96x32.png
gm convert: Unable to open file (/tmp/electron-builder-1107-15860e9a7dc-0/t-1107-1-electron-builder-linux.iconset/icon_256x256x32.png) [No such file or directory].
gm convert: Unable to open file (/tmp/electron-builder-1107-15860e9a7dc-0/t-1107-1-electron-builder-linux.iconset/icon_256x256x32.png) [No such file or directory].]

As a workaround per discussion here: https://github.com/electron-userland/electron-builder/issues/239,
creating a build/icons folder at the app's root directory and placing inside the following images/icons found at https://github.com/develar/onshape-desktop-shell/tree/master/build/icons, addresses the issue.
However, it would be much cleaner if build/icons folder is inside .desktop/assets directory since it is part of meteor-desktop build process in linux. But either way, it doesn't matter as long as it works!!!
Very much grateful for this package!!! Thanks!

I'm glad you have managed to work it out.
Thanks for sharing that knowledge. I will think about it as I already had a .desktop/build directory in plan for 0.3.0 as it is not nice that currently you can not split your assets to the ones needed by build process and the ones needed by the desktop app itself.

@Rongky I'm trying to create a testapp but running into all sorts of issues.
I did meteor create testApp first, then meteor --mobile-server=<IP_ADDRESS>:3000 in one terminal .. it shows the below warning:
I20161116-08:18:29.259(5.5)? [meteor-desktop] .desktop HCP will not work because either web.cordova architecture is missing or the bundler had troubles with creating desktop.asar. Be sure that you are running mobile target or with --mobile-server.
meteor run desktop throws the following error:
ERROR  meteorApp:  no mobile build found at /home/ghost/temp/testApp/.meteor/local/build/programs/web.cordova ERROR  meteorApp:  are you sure you did run meteor with --mobile-server?
Can you pls advise on the exact steps to following to create a test app on Ubuntu?
Thank you.

@Rongky ... pls ignore ... I didn't realize that I need to add a platform even I didnt need one ... I ran meteor add-platform ios and it started fine. Sorry!

No probs @SantoshSrinivas79. That was also my initial error. This step was commented out in the docs, that's why.


Add a Persian language

I would like to add a Persian (Farsi) translation . Can I send a PR?
@natanfelles

Yes!
Please run the tests before submitting the PR. I believe you can do it in a single signed commit.
Finishing this one, could you add Farsi to the libraries below?

CLI
Date
Debug
Pagination
Routing
Validation

Thanks,
Yes Of course ,it's my pleasure I will add Farsi to all of them

Hello, @Mehran-tr !
Are you working on it or could it be closed?

Hello , @natanfelles  ,
I know its too late and Im sorry,Yes I will do it asap!


Update rmf_variants to 0.1.0-1 on jazzy

Bloom succeeded but failed at the last step when opening the rosdistro PR. https://github.com/ros2-gbp/rmf_variants-release

Yup, that happens, you can always rerun bloom with:
  --pull-request-only, -p
                        skips the release actions and only tries to open a pull request

Yup, that happens, you can always rerun bloom with:
  --pull-request-only, -p
                        skips the release actions and only tries to open a pull request

Thanks for the pro tip!


Error when interpolating large videos on Ubuntu

Got another one for you - I am trying to run Butterflow on a very large video which is 4096x2048 pixels. When I run it on Ubuntu using current master, I get the following error:
butterflow -v -s full,spd=1 -r 60 -o interpolated.mp4 orig-4fps.mp4
Traceback (most recent call last):
  File "/home/dan/Documents/repos/butterflow/bin/butterflow", line 9, in <module>
    load_entry_point('butterflow==0.2.0.dev0', 'console_scripts', 'butterflow')()
  File "/home/dan/Documents/repos/butterflow/butterflow/cli.py", line 218, in main
    vid_info['rate_d'])
ZeroDivisionError: float division by zero

If I downscale the video by 50% (to 2048x1024) it works fine. And the full-sized video works (eventually) on my Mac. Here are some test images if you need them (click download with browser). Thanks for taking a look!

Sorry for getting back to you so late on this but can you grab the latest master and tell me what the output of butterflow -prb <file> on the 4096x2048 and the 2048x1024 videos are?

No problem! I'm on my way out of town & off the grid for the next 10 days, but I'll let you know when I get back :)

Hi!
I am running ubuntu and get the same problem using latest master:
(butterflow)mir@leopard ~ $ butterflow -prb test.mkv
Video information:
Streams available  	: video,audio,subtitle
Resolution         	: 1280x720, SAR 1:0 DAR 1:0
Rate               	: inf fps
Duration           	: -3:-14:-8 (-9223372036854776.00s)
Num of frames      	:<PHONE_NUMBER>854775808
while ffmpeg -i tells me on the same file:
Input #0, matroska,webm, from 'test.mkv':
Metadata:
ENCODER         : Lavf56.15.102
Duration: 00:41:18.87, start: 0.083000, bitrate: 2370 kb/s
Stream #0:0(eng): Video: hevc (Main), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
LANGUAGE        : eng
ENCODER         : Lavc56.13.100 libx265
Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)

My bad. Recompiling and linking a good working avformat.so library solved the problem....


setQueryData() should be persisted too, right?

Describe the bug
I'm using the new experimental_createPersister like this:
import { experimental_createPersister, type AsyncStorage } from "@tanstack/query-persist-client-core";
import { get, set, del, createStore, type UseStore } from "idb-keyval";

function newIdbStorage(idbStore: UseStore): AsyncStorage {
  return {
    getItem: async (key) => await get(key, idbStore),
    setItem: async (key, value) => await set(key, value, idbStore),
    removeItem: async (key) => await del(key, idbStore),
  };
}

export const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      gcTime: 1000 * 30, // 30 seconds
      persister: experimental_createPersister({
        storage: newIdbStorage(createStore("db_name", "store_name")),
        maxAge: 1000 * 60 * 60 * 12, // 12 hours
      }),
    },
  },
});

But I just found out that if I call
const SetPlayerTeam = (team: Team) => {
  queryClient.setQueryData<Player>(
    ['player', team.playerId],
    (old) => old && { ...old, team }
  );
};

the in memory cache works (the team is added to player) but there is not setItem() call for this last queryClient.setQueryData(). If I reload the page the team is not on player anymore (unless I invalidate the player manually).
I think this is wrong, because this change should be persisted too.
I'll create a reproduction if you think it might be useful.
How often does this bug happen?
Every time
Platform
Chrome.
Tanstack Query adapter
svelte-query
TanStack Query version
5.4.3
TypeScript version
5
Additional context
I'm using:
"@tanstack/eslint-plugin-query": "5.0.5",
"@tanstack/query-persist-client-core": "5.4.3",
"@tanstack/svelte-query": "5.4.3",
"@tanstack/svelte-query-devtools": "5.4.3",

hmm, good question. Right now, the persister is just a wrapper around the queryFn. If the queryFn doesn't run, we don't persist. And with setQueryData, it doesn't run ... 🤔
@DamianOsipiuk what are your thoughts here?

I agree that it would be important if persistence can be somehow implemented with setQueryData. Right now, the flow breaks when you're using opportunistic updates with useMutation queries.

one problem I'm seeing is that getQueryData also doesn't read from the persisted storage, and it really can't, because persistence can be async, and getQueryData is sync.
why does the flow "break" with optimistic updates though?

Oh and what about if data comes into the cache via hydration 🤔

My mistake about the useMutation flow. I didn't have onSettled invalidate queries to force a refetch in the background. 😅 Doing that makes it work fine 👍🏻

For storing the data, if we have a persister set up on the client level, we could easily hook it up. Or accept persister as a prop, but i would like to avoid that.
The problem is that createPersister currently returns a function. But we only need a small portion of it.
We could introduce a flag to the returned function to control the flow and execute only a portion of it.
Or return different structure from createPersister with few functions that would be picked up in different contexts.
As for getting the data, we would need to introduce another async version of it that will do similar checks as current persister fn.
If cache is empty, try to get from storage if configured, otherwise get from cache (this includes hydrated data). Ofc this will work on-demand, and would not attempt to restore automatically on app load.

Just some general input as I'm testing out the new createPersister in my app. Benchmarking before and after switching, the results are staggering - in some cases 8000x improvement in terms of speed! However I am experiencing some issues all tied to the fact that setQueryData not updating - here are some of them:

I'm using setQueryData to add local-only metadata to certain results. This metadata is NOT available on the server side, and so refetching it would essentially remove the metadata and mess up the state of my data.
My data (it's a timeline of sort) is stored "permanently" on disk (qcTime=Infinity, staleTime=Infinity) locally, and I can't just refetch several thousands queries to update the state. I patch things in the timeline as they come in using setQueryData. Additionally, it's not a guarantee that the original request would even work anymore if I were to invalidate or refetch several days, weeks or months old data.
I use setQueryData to clean up and optimize my timeline data, and this data is also no longer persisted.
I have some background jobs (outside of React context) that change data using setQueryData which correctly rerenders the components with the new data, but that data is no longer updated in the store which is problematic.

I suppose I'm also abusing the library a bit and it was not really meant for all these use cases though, but I do believe that some of them are valid reasons where setQueryData should also persist.

As for getting the data, we would need to introduce another async version of it that will do similar checks as current persister fn. If cache is empty, try to get from storage if configured, otherwise get from cache (this includes hydrated data). Ofc this will work on-demand, and would not attempt to restore automatically on app load.

I think this sounds like a fair solution although I also feel like that could cause issues/bugs if someone for example uses queryClient.getQueryCache().getAll() to "get all" cached queries but it doesn't actually "get all" because some might not be loaded yet with useQuery since they're persisted..  if it loaded everything when app was restored that would be avoided however.
If an async function was added to work around this then people would have to know to use this over the other one when using the new persister.

There are a couple of things that lead me to think having setQueryData write to the persister as well is not a good idea:

we can't make reads work

reads from the cache are synchronous, so getQueryData will never be able to return data from the cache. If we are thinking about a separate getter that somehow can do this, why not a setter as well?

it will only work when the persister is defined globally

If you have useQuery with a persister passed to useQuery directly, setQueryData will not see it, so it won't write to the disk. That's an inconsistency I wouldn't expect.

the queryClient is just a wrapper around the queryCache

it doesn't do anything - you can just as well call queryClient.getQueryCache() and operate on the raw methods instead. By adding this special thing to setQueryData and ensureQueryData, we break that statement.

there are other ways to write to the cache

For example, you can use hydrate to write data to the cache. Would we need to cover them all, or is this just about queryClient.setQueryData()

Imo, being an "ad-hoc" persister was always part of the plan. Async reads (= running the queryFn) would try to read from the storage first, unless there is data already in the cache. It's like "fallback" data. If we get data into the in-memory cache by other means, we don't need to lookup the fallback.
Maybe it's conceptually wrong that the queryFn "writes data back" to the storage after it runs - maybe this should happen on a more global level, with a queryCache subscription ? Then, all writes would be synced back, but reads would only read lazily. @DamianOsipiuk what do you think ?

Well, the cool thing about current solution is that you can add persister directly to useQuery and it just works™.
We could potentially hook to the cache to store it in persister, but I'm kinda worried about adding a listener for every query, if users decide to do it this way.
queryFn is deduped, while listeners are not.
It would work for global persister, but not for the local ones.
Maybe we should just force users to set up persister globally with filterFn for queryKey, or disabling persister for specific useQuery calls. Then we could hook listener on the cache. But ergonomics of this solution is kinda worse than the current one.
We could potentially expose async persistQuery and restoreQuery from createPersister that would take queryKey and queryClient and expect users to call those methods when needed. Ex after setQuery.

It would work for global persister, but not for the local ones.

can you elaborate why there's a difference between global and local ones? The global one is just a default value setting - it's functionally equivalent imo to passing persister manually to all useQuery calls

but I'm kinda worried about adding a listener for every query

PersistQueryClient does that, too, and I think it would still be properly deduped because we would listen only to events that put data into the cache. We could also throttle the writes if necessary.

We could potentially expose async persistQuery and restoreQuery from createPersister that would take queryKey and queryClient and expect users to call those methods when needed. Ex after setQuery.

yeah that's an option. We could also just expose the auto-write subscribe hook and then let users decide which way they want ?

can you elaborate why there's a difference between global and local ones

For global persister you call createPersister only once when instantiating queryClient so we could add only one listener.
For per-query users could createPersister on each render resulting in thousands of listeners.
And I would like to prevent users shooting their foot by using it wrong.
I beleive that PersistQueryClient works differently as listener creation is out of user reach? I might be wrong though.

For per-query users could createPersister on each render resulting in thousands of listeners.

right, I see what you mean. It would have to become a hook like userPersister so that we could use component lifecycle, but then it becomes framework specific again. Even on global level, we would need a way to unsubscribe, which usually requires lifecycle methods. That's why the PersistQueryClientProvider exists, too 🤔

I beleive that PersistQueryClient works differently as listener creation is out of user reach? I might be wrong though.

It sets up a subscription for writes and eagerly restores data. We basically only want the writes, and keep the restores lazily.

In my opinion, the persister should only be an extra layer for performance optimization.
If the way I store and fetch local data is too complex, I would just change queryFn implementation. For instance:
useQuery({
  queryKey: ['items'],
  queryFn() {
    const items = await localDb.getItems()
    if (!items) {
       const networkItems = await getItemsFromNetwork()
       await localDb.saveItems()
       return networkItems
    }
    return items
  }
})

In this case, instead of calling setQueryData after a mutation, I would direcly update the localDb and then invalidate the query to get the updated value.

I would love to be able to setQueryData to the query cache one way or another. The query cache is so much more performant than the client cache.
For us who work on multiple-page applications, the client cache can get quite big in some cases and loads on every navigation.
Having the cache only be loaded when needed would be great for us!
We are considering just using something like https://github.com/epicweb-dev/cachified , but it would defeat the point of using tanstack query.

@TorbjornHoltmon cachified seems an amazing idea!


Sunday has always wrong data

Just use a very simple setup with some zigbee plugs to monitor their power. The bar on sunday is always displayed with values from the current day. The data comes from influxdb. The diagram in the object browser shows correct data. What happened here?
Edit: I use the latest v 1.0.0

In day view there is the same error, too. Displays non existent data for 23:00 Uhr


I can't use my query

I want to increase the pitch of the audio and am writing my request for this. Like this:
fun changePitchAudio(inputAudio: String, rate: Double, pitch: Double, output: String): Array {
val inputs: ArrayList = ArrayList()
inputs.apply {
add("-i")
add(inputAudio)
add("-filter:a")
add("asetrate=${rate * pitch}")
add("-filter:a")
add("aresample=$rate")
add("-filter:a")
add("atempo=${1 / pitch}")
add("-vn")
add("-preset")
add("ultrafast")
add(output)
}
return inputs.toArray(arrayOfNulls(inputs.size))
}
but it not working. Please point me where I am wrong

@dmitriy-kip : We will check ASAP and get back to you.

@ShwetaChauhan18 Thanks

@dmitriy-kip
that depends on many different things for example checking existing rate and pinch.
one thing i notice that you are passing rate as double but it should have as Int
sample query:
fun changePitchAudio(inputAudio: String, rate: Int, pitch: Double, output: String):
            Array<String> {
        val inputs: ArrayList<String> = ArrayList()
        inputs.apply {
            add("-i")
            add(inputAudio)
            add("-filter:a")
            add("asetrate=${rate * pitch}")
            add("-filter:a")
            add("aresample=$rate")
            add("-filter:a")
            add("atempo=${1 / pitch}")
            add("-vn")
            add("-preset")
            add("ultrafast")
            add(output)
        }
        return inputs.toArray(arrayOfNulls(inputs.size))
    }

Sample params would be:
ffmpegQueryExtension.changePitchAudio(inputAudio, rate = 22050,pitch = 0.1, outputPath)
let us know if you have any doubts

@dmitriy-kip : Please lets us know if you still face any issue.

It's doesn't work exactly as I expected, but thanks anyway


[Enhancement] separate life cycle of base table and its materialized views

Proposed changes
Issue Number: close #xxx
Problem summary
Describe your changes.
Checklist(Required)

[ ] Does it affect the original behavior
[ ] Has unit tests been added
[ ] Has document been added or modified
[ ] Does it need to update dependencies
[ ] Is this PR support rollback (If NO, please explain WHY)

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

please add a regression test.

done

run buildall


Bump the jstl version to 1.2.2

Purpose

$subject

Changes from this PR

jstl 1.2.1 has security vulnerabilities.
From this PR, jstl version is bumped to non vulnerable version 1.2.2

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/7469548505

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/7469548505
Status: success


Support swagger type format for global override

Is your feature request related to a problem? Please describe.
I am trying to declare a global override in .swaggo to replace my custom date struct with the string swagger type using the date-time format
Describe the solution you'd like
The solution I would be along the lines of an additional formatting parameter after the type in the 'replace' function e.g.
replace src/types.NullTime string date-time
Describe alternatives you've considered
One workaround I've explored is to replace this type with another custom type with the correct swagger format:
type NullTimeSwagger struct {
	String *string `swaggertype:"string" format:"date-time"`
}

However, the generated doc places the date-time string inside a struct, which is undesirable.

hope same
type SFID int64

type GreeterReq struct {
	ID SFID `json:"id"`
}

The result I want is type:string, format: int64
I don't want to label every field that uses SFID, but I want to rewrite it through the interface, or--overrides Fileld


Index when child model is saved.

Using Rails 3.2, Riddle 1.5.7, Thinking Sphinx 3.0.4. Below is my model association:
# country.rb
class Country < ActiveRecord::Base
  has_many :states
  has_many :shops, :through => :states
end

# state.rb, with country_id
class State < ActiveRecord::Base
  belongs_to :country
  has_many :state_shops
  has_many :shops, :through => :state_shops
end

# state_shop.rb, with state_id, shop_id
class StateShop < ActiveRecord::Base
  belongs_to :state
  belongs_to :shop
end

# shop.rb
class Shop < ActiveRecord::Base
end

I put after_save ThinkingSphinx::RealTime.callback_for(:country) in country.rb which works fine. When a new state_shop is created/destroyed, I want TS to index the shop that is wrapped in it. I tried to play around with the after_save above and associations, but I couldn't get TS to update the index. How should I make it work?
Noob suggestion: initially I thought by touching the country model, it would get the new changes indexed, but it didn't. Do you think this is a good suggestion - as long as the indexed model is touch, then it will be reindexed?

Hi Pat,
What would be the solution for deltas?

@atomical you'll probably want a callback that sets the delta flag to true for the parent object and then saves it (in a way that would fire its own callbacks):
http://freelancing-gods.com/thinking-sphinx/deltas.html#deltas-and-associations

Sorry about not creating a separate issue for this. In hindsight I should have done that.
I seem to recall that Sphinx checks attributes to see if they are changed. Is that correct? If I set delta: true and then save the parent object will it update a reference to another table if no other AR attributes have been changed:
 indexes "date(tracking_numbers.ship_date)", as: :ship_date_txt, sortable: true

That callback you've highlighted is for updating attribute values directly in Sphinx. For deltas, however, it only checks changed? rather than any specific attributes - so, setting delta to true will be enough to prompt a delta update.
I think in TS v2 the behaviour was more what you were thinking (with attribute/field value checks happening), but that's relatively intensive and rarely worth it.

I got it working. Thanks.


Dynamic loaded Async component event listener not work on SSR first rendered

Versions

nuxt: 2.15.3
node: stable

Reproduction
https://stackblitz.com/edit/nuxt-starter-lzv1me?file=pages%2Findex.vue
Steps to reproduce
Index.vue
<DynamicComp @click.native="handleClick" />

DynamicComp.vue
<component is="AsyncComp" />

AsyncComp.vue

click me

What is Expected?
click event work first SSR rendered
What is actually happening?
click event not works first SSR rendered, works only CSR rendered (wrap <ClientOnly> or change component key to re-render)
https://stackblitz.com/edit/nuxt-starter-lzv1me?file=pages%2Findex.vue

We are approaching the Nuxt 2 EOL date (June 30, 2024) - see this article for more information. This is advance warning that I'm going to close this issue then, as it's currently marked as a Nuxt 2 related bug.
If it's a critical or security issue, please do comment and let me know, in case it is possible to address it before the EOL date.
If it's a an issue you think is relevant for Nuxt 3, please feel free to open a fresh issue (or just comment here so I can update labels, etc.). 🙏
Thank you for your understanding and for your contribution to Nuxt. ❤

It's the day, at last. Nuxt 2 is now marked end-of-life.
My apologies we never got round to resolving this bug in the 2.x branch, but we do have to draw a line somewhere. Again, if you think this is still relevant for Nuxt going forward, please feel free to open a fresh issue (or just comment here so I can update labels, etc.). 🙏


Issue #32: Option to exclude min/max values in range validation constraints

Added new range validation constraints minimumValueExclusive and maximumValueExclusive for use with integer, float, date and datetime validation types. They are similar to minimumValue and maximumValue, respectively, except that they do not allow values that are equal to the specified range limit value.
Addresses issue #32.

Looks good 👍


Added new quote

Added a new quote to the JSON file

Resolve merge conflicts!

I Have resolved the conflicts , please merge the pull request

Resolve merge conflicts!


Cropped Image points

How can I get x & y points of cropped Image?
I am using
val left = result.cropRect.left
val top = result.cropRect.top
val width = result.cropRect.height()
val height = result.cropRect.width()
But this gives me not correct points

Hey!
I start a new project to handover this library
https://github.com/CanHub/Android-Image-Cropper
The ideia is that we keep improving because this project don’t have updates since 2018
Hope I can count with your help.
Open to contribute, next pieces of work will be Android 11 permissions, refactor into Kotlin and ActivityContract


Prevent reset password token leakage

The current implementation of the password reset page using a reset token leaves the reset token in the url's query parameters, which run the risk of exposing it via the Referer. This solution, grabs the reset token, stores it in the session, and redirects the user to the reset password page (/edit) without the reset token in the query parameters.

@akayvanfar specs are appreciated

@ethirajsrinivasan thanks for the quick feedback. I'll add some and re-submit.


bootstrap4 home pages

Different home page for logged-in users
If not logged in, home is Observation Index
If logged in, it's rss feed
See https://github.com/MushroomObserver/mushroom-observer/pull/603#discussion_r452480856, et seq.

I will close this, redo with a different branch name.


remove duplicate function

Java side has same function, so we can delete it from scala side.

/run-all-tests


#577 Small area of the search button of the workbench does not work

Description

워크벤치 결과 영역에 있는 검색버튼이 동작하지 않습니다.
Related Issue : #577

How Has This Been Tested?

워크벤치를 띄웁니다.
쿼리를 실행하여 결과창을 표시합니다.
결과창 우측 하단에 있는 검색버튼을 클릭하여 검색바가 표시되는지 확인합니다.

Types of changes

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[ ] My code follows the code style of this project. it will be added soon
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document. it will be added soon
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Additional Context

run build
deploy to 5

@eltriny 다운로드 버튼 배경색이 회색입니다.

run build
deploy to 2


Adding stencil_iterator and transform_iterator

This pull request proposes to add two new iterators: transform_iterator and stencil3_iterator.
The transform_iterator is very similar to boost::transform_iterator with the main difference of allowing to modify the iterator itself instead of the dereferenced value only.
The stencil3_iterator is an example of how the new transform_iterator can be used to generate a stencil (3 elements wide) on the fly, which allows to reuse the standard algorithms for problems relying on stencil computations:
std::vector<double> values = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
auto r = hpx::util::make_stencil3_range(
    values.begin(), values.end(), &values.back(), &values.front());

typedef typename std::iterator_traits<decltype(r.first)>::reference
    reference;

std::for_each(r.first, r.second, [](reference val)
{
    using hpx::util::get;
    hpx::cout
        << get<0>(val) << " "
        << get<1>(val) << " "
        << get<2>(val) << std::endl;
});

This will print:
9 0 1
0 1 2
...
7 8 9
8 9 0

I like the general idea of this, however I think it the stencil3_iterator has a potential performance problem: Dereferencing it involves 3 comparision operations. Compared to an equivalent "naive" implementation this sounds like quite some performance hit.
In addition, I am not sure if hpx::util Is the proper namespace for that, as naming is hard, I don't have a better suggestion ...

Unit tests and documentation would be nice too ;)

Yes, the performance has to be properly tested. I'll go and add a corresponding test. I'm not too concerned about the dereferencing (this has to be done in any case, even for the 'naive' case), but I agree that the comparison operation (there are only two of those, not three) might impact the performance. Measurements will show...

Of course ... two comparisions per dereference and the three in each loop have already been optimized. Sure, dereferencing per se is not the problem, the comparison hidden inside probably is.

Am 27.03.2015 21:48 schrieb "Hartmut Kaiser"<EMAIL_ADDRESS>
Yes, the performance has to be properly tested. I'll go and add a
corresponding test. I'm not too concerned about the dereferencing (this has
to be done in any case, even for the 'naive' case), but I agree that the
comparison operation (there are only two of those, not three) might impact
the performance. Measurements will show...

I guess one possible way to avoid those unnecessary comparisons is that the
stencil iterator only deals with the interior region and the boundary
should be handled separately, at least that's what the current best
practices suggest.

—
Reply to this email directly or view it on GitHub.

I guess one possible way to avoid those unnecessary comparisons is that the
stencil iterator only deals with the interior region and the boundary
should be handled separately, at least that's what the current best
practices suggest.

I'll do some measurements.

The commit above (5e372cd2ccb62b3a73b00037f5be7a4320cd39c5) adds versions for both iterators which require to handle the boundary cases explicitly. It also adds tests.

I want to suggest a slight generalization of this API. This generalization is probably not relevant for shared memory, but improves efficiency in many cases when using distributed memory.
The use case is that the iterator is not used for finite differencing, but for finite volumes or DG finite elements. In this case, each element of the data structure contains not just one value, but many -- for example, it could hold five coefficients of a Chebyshev expansion.
What is needed when calculating fluxes for one element is usually not the full information of the neighbouring elements, but only their boundary data. Thus I want to suggest to expand the API to allow for an additional transformation function to be called before creating the tuple that represents (prev, elem, next). Let's call the function b (for "extract boundary value"); the tuple should then contain (b(prev), elem, b(next)).
The efficiency gain comes from evaluating b on the remote locality where the respective element is already processed, and then transferring less data.

@eschnett: Thanks for those suggestions. I added the ability to supply your own transformer. For an example, see: https://github.com/STEllAR-GROUP/hpx/blob/transform_iterator/tests/unit/util/stencil3_iterator.cpp#L40.

The implementation of hpx::util::stencil3_iterator is now almost as efficient as the plain explicit implementation of a 3-wide 1d stencil (see https://github.com/STEllAR-GROUP/hpx/blob/transform_iterator/tests/performance/local/stencil3_iterators.cpp for some timing results). I think we can go ahead and merge this pull request now.

That was quick. Thanks!

I am still not particularly happy that the stencil3 iterator lives in the util namespace. I think we should stop polluting this namespace unnecessarily, especially since this iterator is a very special case and more of an example of how to use the transfomer functionality.

I am still not particularly happy that the stencil3 iterator lives in the util namespace. I think we should
stop polluting this namespace unnecessarily, especially since this iterator is a very special case and
more of an example of how to use the transfomer functionality.

What do you suggest as an alternative?

In my mind, a stencil3 iterator is a special case of a more generic operation that lives on the same footing as each of map, reduce, or mapreduce. It should be treated as such. If you modify the name to stencil_nearest_neighbour, then it is clear that this special case is rather important in practice and deserves to be part of a standard library. The namespace choices are thus either hpx::experimental or hpx::example, with the goal of putting it directly into hpx.

Are there any plans to extend this beyond a 1D stencil? If so: what's the overhead (compared to an optimized implementation) you'd be able to accept?

My suggestion would be to provide a generic iterator utility module. Probably living under hpx::iterators. I don't think it is wise for us to include something like stencil or nearest neighbor iterators with HPX itself, this clearly is out of scope for HPX itself. As such, I think the stencil3_iterator should be merely an example while the other iterator utilities should live under hpx::iterators. Does this make sense?

@sithhell: I agree. My plan is to build a set of tools which allow to efficiently build views (stencil3_iterator is just one example of doing this). The concept of views allows to integrate parallelization techniques with container access. All of the current work is merely some experiment to find the right abstractions.

@gentryx: Overhead? Why should there be an overhead? I expect the actual stencil operation to be cheap (otherwise overhead would not be an issue). Thus the stencil operation and the iterator calls should be inlined into the enclosing loop, which should then be SIMD-vectorized. I would not expect HPX to stand in the way of this.
In a multi-dimensional loop, one probably needs to employ loop blocking. I don't expect the compiler to make a good choice; the blocking size would be chosen by the user either with the loop or with the iterator's container. In this case, I expect the innermost loop to be inlined as described above, and the outermost loop to schedule each innermost loop as a separate thread. I don't know whether HPX's containers or iterators can do this already, but that should be the goal. In the end, it should run as efficiently as an OpenMP construct if the loop is perfectly regular, and faster if HPX can exploit any dynamic differences.

@eschnett: That's exactly the goal of this excercise! Nicely put!

Am 31.03.2015 15:02 schrieb "Hartmut Kaiser"<EMAIL_ADDRESS>
@sithhell: I agree. My plan is to build a set of tools which allow to
efficiently build views (stencil3_iterator is just one example of doing
this). The concept of views allows to integrate parallelization techniques
with container access. All of the current work is merely some experiment to
find the right abstractions.

nod I think having those experiments live in the right namespace from the
start avoids future confusions and potential massive refactoring.

—
Reply to this email directly or view it on GitHub.

@eschnett That's why I was asking. The assumption that the compiler will efficiently vectorize the code should not be taken for granted. Compilers easily get confused, especially with boundary cases. In 3D there are 2^6 = 64 different boundary cases. All can be resolved at compile time, so that there is (next to) no runtime overhead, but it's complicated. Very subtle changes in the iterator can severely affect performance. Things get worse if you want to ensure efficiency across a wide range of compilers and hardware platforms.
It's all doable (I'm doing it with LibGeoDecomp), but I'd suggest to not reinvent the wheel if HPX library support for 3D stencils was planned. Then again @sithhell didn't sound like this was the overall goal.

The latest commit solves all issues mentioned above.


Upgrade markdown-it-video [OSF-6130]

Purpose
Markdown-it-video has upgraded to a new version that has Vine support and bug fixes. The version used by the OSF did not have these changes, so an upgrade was necessary. After the upgrade was implemented, testing was done to ensure everything still works. Autocomplete for Vine and Prezi has also been added.
Changes
Vine and Prezi can be embedded into the Wiki editor by using the same Markdown syntax used for Youtube and Vimeo. This was possible after updating the version number in package.json.
@youtube
@vimeo
@vine
@prezi
Adding snippets to ace-markdown-snippets.js for Vine and Prezi allowed for both websites to be autocompleted as well as Youtube and Vimeo.

Side effects
N/A
Ticket
https://openscience.atlassian.net/browse/OSF-6130

Looks great! 🎉 🐧 🎉


[1.20] repository solr playbook contains unused template

There is a template in https://github.com/geerlingguy/ansible-for-devops/tree/1.20/solr/provisioning/templates
Neither in the book nor in the repo playbook the  template is used.

Interesting! Probably an artifact from the time when the example was used for Solr 3.x back when the book was originally being written. I'll take a look on my next book update.

Fixed in above commit. Must've been a remnant from the old days.


Website does not render correctly on mobile

Website does not render correctly on mobile which makes you swipe to the right to see the navigation which has a white gap.

Are there specific issues that you'd like addressed, other than the horizontal scrolling of some of the pages like the homepage:

/cc @nate-double-u

I think that's about right, unless you have other issues @zroubalik ?

Related: https://github.com/kedacore/keda-docs/discussions/503

Yeah, that's the main problem imho, thanks @chalin


ceph-defaults: regenerate group_vars samples

In fc02fc9 the group_vars samples have been generated but only for
monitor_address variable not radosgw_address.
Signed-off-by: Dimitri Savineau<EMAIL_ADDRESS>

jenkins test centos-container-purge


Do not print 'undefined' when there is no msg in the pretty printer

@davidmarkclements please review :)

good to go


Conflict occurred creating export directory already exists

when i write two bigquery dataframes in for loop using function saveAsBigQueryTable(projectid+schemaname+tablename) it gives the error when writing the table in bigquery where it gives error   Conflict occurred creating export directory. Path gs://mybucket_name/hadoop/tmp/spark-bigquery/spark-bigquery-1595825912980=521003067 already exists
plz reply with solution

hmmm that sounds like a race condition issue? can you validate if that is the case? try sleeping between writing frames for a certain amount of time
Id like to know more if its due to a race condition or perhaps the way you are saving the table


What is the difference between this and what Facebook supports?

https://github.com/facebook/react-native-fbsdk

Android version?

Android support is probably the biggest one.
This library was also created long before Facebook released a similar repository. I mostly wrote it as a learning experience with react-native. That having been said, the react-native-fbsdk repo does have more wrappers for various components of the Facebook API, but I believe you can achieve similar results with either library from the javascript side of things.


refactor(semantic): simplify raising errors in transform checker

Simplify creating errors in transformer checker.

#5051  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @overlookmotel and the rest of your teammates on  Graphite

I said I'd finished with refactoring. I lied! But now I have...


feature request: support for wildcard schema/useAllSchemas flag/config

One of the reasons we're using a tool to map out oru DC for our documentation is that our DB isn't... cleanly seperated. Because of that individually mapping schemas means the bridges get missed, is there a way to add either a wildcard option in the checma selection/config and/or add a useAllSchemas flag/config to allow mapping between schemas?

Would it be ok if the schema selection would be the same as for the tables?

multiselection via cli
list of schemas in (run-)config
a --useAllSchemas flag

it would not be a wildcard option, but rather a multiselect

Sounds perfect!
Get BlueMail for Android
On Sep 12, 2022, 8:45 PM, at 8:45 PM, KarnerTh @.***> wrote:

Would it be ok if the schema selection would be the same as for the
tables?

multiselection via cli
list of schemas in (run-)config
a --useAllSchemas flag

it would not be a wildcard option, but rather a multiselect
--
Reply to this email directly or view it on GitHub:
https://github.com/KarnerTh/mermerd/issues/23#issuecomment-1244113193
You are receiving this because you authored the thread.
Message ID: @.***>

I finally found the time - support for multiple schemas is now added in version 0.5.0
you can use the --useAllSchemas flag, the interactive cli or a list of schemas in your (run-)config. Examples are in the readme


[BI-1036] Add backend sorting to program users table

This only adds sorting to the program users table because not all of our tables use buefy yet.

Do we have cards to do this on other buefy tables?

I just added one to do so https://breedinginsight.atlassian.net/browse/BI-1098

Do we have cards to do this on other buefy tables?

I just added one to do so https://breedinginsight.atlassian.net/browse/BI-1098

Cool, thanks


Rmtree for nfs

Summary of Changes
Some filesystems like NFS don't delete files right away, especially if another node might be holding access to them. This manifests as files like .nfs.... in the directory being deleted. rmtree will complain after deleting files and trying to delete the folder.
This PR adapts a utility from another open sources (BSD-3-clause) license repo that deals with this problem for clusters with NFS. Basically, if we hit one of the common errors (resource or device is busy), we wait a few seconds and try again.
I don't know how to reproduce this test without an NFS filesystem, but the existing tests should cover this working as expected for file deletion.
Requirements

[x] My PR is focused on a single feature addition or bugfix.
[x] My PR has relevant, comprehensive unit tests.
[x] My PR is on a custom branch (i.e. is not named main).

Note: If you are an external contributor, you will see a comment from @buildbot-princeton. This is solely for the maintainers.

Can one of the admins verify this patch?

@zulissimeta: Happy to accept something along these lines. First, a quick question though: is it unavoidable that the .nfs files will be present? For instance, this comment suggests that I/O on the node could cause this (e.g. from the logging module). I want to confirm that killing the logger before calling shutil.rmtree isn't sufficient here in terms of a fix.

@zulissimeta: Happy to accept something along these lines. First, a quick question though: is it unavoidable that the .nfs files will be present? For instance, this comment suggests that I/O on the node could cause this (e.g. from the logging module). I want to confirm that killing the logger before calling shutil.rmtree isn't sufficient here in terms of a fix.

I haven't been able to reproduce it consistently. Is the logger writing local files?

@zulissimeta: Happy to accept something along these lines. First, a quick question though: is it unavoidable that the .nfs files will be present? For instance, this comment suggests that I/O on the node could cause this (e.g. from the logging module). I want to confirm that killing the logger before calling shutil.rmtree isn't sufficient here in terms of a fix.

I haven't been able to reproduce it consistently. Is the logger writing local files?

I think by default it writes to stderr, if relevant. I should probably be writing this out to a dedicated file in hindsight.

@zulissimeta: Out of curiosity, are you running ASE relaxations? I think there might be a problem with the trajectory not closing properly. I have vague recollections of this...


Respect base branch when triggering builds

Thank you for submitting a pull request! Maybe @karlhto can review this?


LAG-4727 Test back button behavior on Catalyst detail record

This adds the tmp/cache folder to capistrano's shared folders
this will avoid creating a new cache when deploying.

Codecov Report

Merging #206 (1f0ce31) into develop (26850f4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop     #206   +/-   ##
========================================
  Coverage    78.97%   78.97%
========================================
  Files           82       82
  Lines         2835     2835
========================================
  Hits          2239     2239
  Misses         596      596

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26850f4...1f0ce31. Read the comment docs.


ASP.NET MVC Core with EF Core - LEFT Outer Join in LINQ always returning top 1 record if a right side column in the WHERE clause is set to null

ISSUE: In my ASP.NET MVC Core app with EF Core, LEFT OUTER Join with a Where rightColumnName == null clause is always returning the one record that is the top row of the result. I'm using VS2015-Update3. And this is Code First project (not db first). Moreover, there is no FK relationship implemented between two tables.
In my following sample data tables the customer C1 has ordered Vegetables and C2 has ordered Fruits. I want to display name of potential customers C3 and C4 who have not orders yet. So, I use an Outer Join but query always returns the first cutomer C1. It seems a bug or something wrong with my where clause.
Customers Table data:
CustomerID  CustName
1                    C1
2                    C2
3                    C3
4                    C4

Orders Table data:
OrderID CustomerID  OrderType
1             1                   V
2             2                   F
3             1                   V

LINQ Query to display potential customers with no orders yet:
public class TestDbController : Controller
    {

       public async Task<IActionResult> TestAction(List<CustomersViewModel> list)
       {
          var Qry = from c in Customers
                     join ord in Orders on c.CustomerId equals ord.CustomerId into c_o
                     from t in c_o.DefaultIfEmpty()
                     where t == null
                     select new  CustomersViewModel() {CustName = c.CustName};
          return View(qry.ToList());
        }
    }

SQL Server Profiler captures the following following SQL that returns all customers (instead of C3, C4 only):
exec sp_executesql N'SELECT [c].[CustNumber], @__Empty_0
FROM [Customers] AS [c]
LEFT JOIN [Orders] AS [ord] ON [c].[CustomerID] = [ord].[CustomerID]
ORDER BY [c].[CustomerID]',N'@__Empty_0 nvarchar(4000)',@__Empty_0=N''

But my view is showing only one record. Also, when I place a breakpoint at @for (int t=0; t<Model.Count; t++) in my view shown below, it shows only 1 at the Model.Count:
@model List<MyProject.Models.MyViewModels.CustomersViewModel>

    <form asp-controller="TestDb" asp-action="TestAction" method="post">

             @for (int t=0; t<Model.Count; t++)
                {

                     <input type="hidden"<EMAIL_ADDRESS>
                     <input type="text"<EMAIL_ADDRESS>

                }

      <button type="submit">Save</button>
  </form>

EF version installed on the project:
I followed the instruction from this ASP.NET official article to install the EF Core. Following is the image from my Project Reference Directory:

Based on data above I tried to make a stand-alone repro. I am getting 2 results - "C3", "C4" as expected.
public class Program
{
    public static void Main(string[] args)
    {
        using (var db = new MyContext())
        {
            var serviceProvider = db.GetInfrastructure();
            var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
            loggerFactory.AddConsole(LogLevel.Information);
        }

        using (var db = new MyContext())
        {
            db.Database.EnsureDeleted();
            db.Database.EnsureCreated();

            var cust1 = new Customer {CustomerName = "C1"};
            var cust2 = new Customer {CustomerName = "C2"};
            var cust3 = new Customer {CustomerName = "C3"};
            var cust4 = new Customer {CustomerName = "C4"};

            var order1 = new Order {Customer = cust1, OrderType = "V"};
            var order2 = new Order {Customer = cust2, OrderType = "F"};
            var order3 = new Order {Customer = cust1, OrderType = "V"};

            db.AddRange(cust1, cust2, cust3, cust4, order1, order2, order3);
            db.SaveChanges();
        }

        using (var db = new MyContext())
        {
            var list = (from c in db.Customers
                        join ord in db.Orders on c.CustomerId equals ord.CustomerId into c_o
                        from t in c_o.DefaultIfEmpty()
                        where t == null
                        select new CustomersViewModel() { CustName = c.CustomerName }).ToList();

        }
    }
}

public class MyContext : DbContext
{
    public DbSet<Order> Orders { get; set; }
    public DbSet<Customer> Customers { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=_ModelApp;Trusted_Connection=True;")
            .EnableSensitiveDataLogging();
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
    }

}

public class Customer
{
    public int CustomerId { get; set; }
    public string CustomerName { get; set; }
}

public class Order
{
    public int OrderId { get; set; }
    public int CustomerId { get; set; }
    public Customer Customer { get; set; }
    public string OrderType { get; set; }
}

public class CustomersViewModel
{
    public string CustName { get; set; }
}

Following is the SQL query generated
SELECT [ord].[OrderId], [ord].[CustomerId], [ord].[OrderType], [c].[CustomerName]
FROM [Customers] AS [c]
LEFT JOIN [Orders] AS [ord] ON [c].[CustomerId] = [ord].[CustomerId]
ORDER BY [c].[CustomerId]

Since the generated SQL is somewhat different, which version of EF Core are you using? I used version 1.0.0 to generate above.
Also can you put break point inside controller action method to see if EF query is returning correct data or not? From results returned by EF to generating view there are other components which could contribute to bug. So it would be better to pin-point from where the bug is coming from.

@smitpatel I'm also using EF Core 1.0. I've included a snapshot of Reference directory in my project (if that can help) in the last section of my post above. Also I've included a note in the post that I'm using Code First approach (not Db first). The query from the profiler you are getting is the same except that my profiler is using exec sp_executesql. Could it be a SQL Server version difference? I'm using SQL EXPRESS 2014. Moreover,

Your SQL generated query (when run in SSMS) will also display all rows with matching CustomerId and the rows with right side columns to be null. I thought the profiler would return your query with a Where clause as Where **ord**.CustomerId is NULL

I see you using db.Database. I'm not using EF Database Class. Could that make a difference?

@saf-itpro
I have also used code first approach.
Query profiler shows sp_executesql when there are parameters to be passed to the query. Parameter-less query would show up as T-Sql only. I am also using Sql Server 2014.

Generated Sql fetches all rows from server but EF filters them out on client. I am looking more into it why the translation of where clause is blocked but regardless, the query you showed also lacked where clause. So EF should be returning correct results at the end of the query.

db.Database is internal class in EF and not related to Database class you posted link about. I used it to delete & create database. (basically make a fresh copy of database and insert data before running query)

@smitpatel Thank you for clarifying #1 and #2 above. Also, I've created a sample project for testing the issue. The project can be download from GitHub here .
In this ASP.NET MVC Core app the POST action method Test is not returning the expected results. The web app was created using this official ASP.NET Core site and was modified slightly.
If you download the project, you will need to do the following steps to test the above unexpected results:
Note:  Order of these steps is important. This is a very small test project. Step2 will create a small SQL Server Db called ASPCore_BlogsNAxis. So make sure SQL Server is runing:

After you download the project, make sure you delete the .vs folder from the project directory before opening the project in VS2015 (if project hangs, you may have to force close it using Task Manager of windows os and re-open it to make it work. This is a known issue in VS2015).

Open startup.cs file and in the Configuration() method change the database instance name from MyComputer\SQLServerInstance to whatever instance you are using. Do the same in the appsettings.json file in the root directory.

In VS2015 PM window, run PM> update-database -context BloggingContext [Make sure SQL Server is running]

Then run: PM> update-database -context ApplicationDbContext

Run the web app. Register by entering a login/password info. login need to be in an Email<EMAIL_ADDRESS>form. On the left side of Home page:

Click on the link Blog Create to create 4 blogs as<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>

Click on the link Blogs Index to verify all the above 4 blogs were created

Click on the Test link. This view is called by the GET action method Test. On the corrsponding view (Test.cshtml) you will see Url column on the page is showing all 4 above blogs. And Title and Content columns are blanks. Fill the Title column as: Title1, Title2, Title3, Title4. Fill the Content column as: Content1 ,Content2 ,Content3 ,Content4

Now, go to the corresponding SQL Server DB called ASPCore_BlogsNAxis and open Posts table in Edit mode to manually change the PostYear column values to: 1998,1999,1998,2001 respectively (note: 1998 is repeated on purpose)

Now, go to Blogs table in the same SQL Server DB and enter an extra blog<EMAIL_ADDRESS>

Now, run the web app and click on Test link (on the left side of the Home page) again. You'll see that the Get action method Test is using left outer join to display all 5 blogs but the right side columns (Title and Content) are blanks, as expected, since left outer join does not satisfy the join condition on BlogId for the 5th blog. So far so good.

Now, on the Year dropdown on the Home page, select year as 1998 and click on GO button. According to the first if condition of the POST action method Test the app should display only three records (two for 1998 and the 5th one that does not satisfy join condition): first, 3rd, and 5th record.

But that's not what happening. When you repeat this action by selecting various years years from the dropdown and click GObutton, you'll see the output is not as expected.
BlogsController:
public class BlogsController : Controller
{
    private readonly BloggingContext _context;

    public BlogsController(BloggingContext context)
    {
        _context = context;
    }

    // GET: Blogs
    public async Task<IActionResult> Index()
    {
        return View(_context.Blogs.ToList());
    }

    // GET: /Blogs/Test
    [HttpGet]
    public async Task<IActionResult> Test(string returnUrl = null)
    {
        ViewData["ReturnUrl"] = returnUrl;
        ViewBag.YearsList = Enumerable.Range(1996, 29).Select(g => new SelectListItem { Value = g.ToString(), Text = g.ToString() }).ToList();

        //return View(await _context.Blogs.Include(p => p.Posts).ToListAsync());
        var qrVM = from b in _context.Blogs
                    join p in _context.Posts on b.BlogId equals p.BlogId into bp
                    from c in bp.DefaultIfEmpty()
                    select new BlogsWithRelatedPostsViewModel { BlogID = b.BlogId, PostID = (c == null ? 0 : c.PostId), Url = b.Url, Title = (c == null ? string.Empty : c.Title), Content = (c == null ? string.Empty : c.Content) };
        return View(await qrVM.ToListAsync());
    }

    // POST: /Blogs/Test
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Test(List<BlogsWithRelatedPostsViewModel> list, string GO, int currentlySelectedIndex, string returnUrl = null)
    {
        ViewData["ReturnUrl"] = returnUrl;
        ViewBag.YearsList = Enumerable.Range(1996, 29).Select(g => new SelectListItem { Value = g.ToString(), Text = g.ToString() }).ToList();

        if (!string.IsNullOrEmpty(GO))
        {
            var qrVM = from b in _context.Blogs
                        join p in _context.Posts on b.BlogId equals p.BlogId into bp
                        from c in bp.DefaultIfEmpty()
                        where c == null? true : c.PostYear.Equals(currentlySelectedIndex)
                        select new BlogsWithRelatedPostsViewModel { BlogID = b.BlogId, PostID = (c == null ? 0 : c.PostId), Url = b.Url, Title = (c == null ? string.Empty : c.Title), Content = (c == null ? string.Empty : c.Content) };
            return View(await qrVM.ToListAsync());
        }
        else if (ModelState.IsValid)
        {
            foreach (var item in list)
            {
                var oPost = _context.Posts.Where(r => r.PostId.Equals(item.PostID)).FirstOrDefault();
                if (oPost != null)
                {
                    oPost.Title = item.Title;
                    oPost.Content = item.Content;
                    oPost.PostYear = currentlySelectedIndex;
                    oPost.BlogId = item.BlogID; //according to new post below the blogId should exist for a newly created port - but just in case
                }
                else
                {
                    if (item.PostID == 0)
                    {
                        Post oPostNew = new Post { BlogId = item.BlogID, Title = item.Title, Content = item.Content, PostYear = currentlySelectedIndex }; //need to use currentlySelectedIndex intead of item.FiscalYear in case of adding a record
                        _context.Add(oPostNew);
                    }

                }
            }
            await _context.SaveChangesAsync();
            //return RedirectToLocal(returnUrl);
            return View(list);
        }

        // If we got this far, something failed, redisplay form
        return View();
    }

    // GET: Blogs/Details/5
    public async Task<IActionResult> Details(int? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var blog = await _context.Blogs.SingleOrDefaultAsync(m => m.BlogId == id);
        if (blog == null)
        {
            return NotFound();
        }

        return View(blog);
    }

    // GET: Blogs/Create
    [HttpGet]
    public IActionResult Create()
    {
        return View();
    }

    // POST: Blogs/Create
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind("BlogId,Url")] Blog blog)
    {
        if (ModelState.IsValid)
        {
            _context.Blogs.Add(blog);
            await _context.SaveChangesAsync();
            return RedirectToAction("Index");
        }
        return View(blog);
    }

    // GET: Blogs/Edit/5
    public async Task<IActionResult> Edit(int? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var blog = await _context.Blogs.SingleOrDefaultAsync(m => m.BlogId == id);
        if (blog == null)
        {
            return NotFound();
        }
        return View(blog);
    }

    // POST: Blogs/Edit/5
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Edit(int id, [Bind("BlogId,Url")] Blog blog)
    {
        if (id != blog.BlogId)
        {
            return NotFound();
        }

        if (ModelState.IsValid)
        {
            try
            {
                _context.Update(blog);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BlogExists(blog.BlogId))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }
            return RedirectToAction("Index");
        }
        return View(blog);
    }

    // GET: Blogs/Delete/5
    public async Task<IActionResult> Delete(int? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var blog = await _context.Blogs.SingleOrDefaultAsync(m => m.BlogId == id);
        if (blog == null)
        {
            return NotFound();
        }

        return View(blog);
    }

    // POST: Blogs/Delete/5
    [HttpPost, ActionName("Delete")]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> DeleteConfirmed(int id)
    {
        var blog = await _context.Blogs.SingleOrDefaultAsync(m => m.BlogId == id);
        _context.Blogs.Remove(blog);
        await _context.SaveChangesAsync();
        return RedirectToAction("Index");
    }

    private bool BlogExists(int id)
    {
        return _context.Blogs.Any(e => e.BlogId == id);
    }
}

@saf-itpro - Thank you for repro code. I played around with changing years and concluded following:
When the table has x rows visible, you select a year and the result has y rows then,

If x > y, then table will show first y rows from existing table ignoring the result altogether.
If x < y, then table will show first x rows as it was present before and rows after that will come from results.
Therefore when you select a year with no results, then the next year selection will give you correct results. Anything else is just incorrect results.

I have debugged queries to verify results generated by EF. EF queries are returning correct results only. You can store the results of ToListAsync() in a temporary variable before passing it to View() and check results generated by EF. You can also put break point in Test.cshtml file around model to analyze it.
There is some issue in the View which is causing incorrect data to be shown. From EF side everything is working as expected.
Here is the standalone repro, which also shows correct results.
https://gist.github.com/smitpatel/f6dbaf781a25c3311c55cb2f80969faa

@smitpatel First I must acknowledge your sincere efforts to deeply look into the issue (as you must have other issues to tackle as well).

I agree with your observation about when correct results are displayed except that even in those cases it should display an extra row (when join does not meet) since the Where clause in the POST Action method Test(...) has two condition with one being when right column values are null as shown here: where c == null? true : c.PostYear.Equals(currentlySelectedIndex).
I don't see an issue with the Test.cshtml view. Could you or someone in your team point out what the issue is in the View?

@saf-itpro

I also got confused at this one at start. Given the code difference between what you posted above and in the repro code.
Here is the culprit
https://github.com/saf-itpro/ASP_Core_Blogs_GitHub/blob/master/src/ASP_Core_Blogs/Controllers/BlogsController.cs#L57
The DefaultIfEmpty() has new Post() as argument. So whenever the columns are null it will initialize new post therefore c is never null actually. Since newly initialized post has PostYear as 0 the condition is not met hence record is not shown.

Based on my limited expertise on MVC, I also could not figure out what is the issue with view rendering. Perhaps you can file a bug on MVC repo and those folks can help you out.

@smitpatel I had added new Post() after I encounter the original issue hoping that would make any difference. But, sorry, I forgot to remove that from the repo. But, actually removing that causes even another issue as follows:

It always includes the top row now matter what year you select even if select a year that doesn't have a record (e.g. 1999, 2000 etc.). If you select a year that has record(s) those record(s) will be displayed along with first top row.

@saf-itpro - Did you verify results returned by EF query using debugger? Above behavior seems like just different behavior of same issue happening in generating the View.
I would advice using debugger step-by-step in your app to see what parts are working correctly so that you can pin-point the part which is causing the issue.
If you want to play around with different queries only (just EF part) then I have posted repro code in a gist. Just put it in any normal console app, change connection string and you can try different queries and see results generated by EF.

@smitpatel I did verify results returned by EF query using debugger and it indeed returns the correct data. But the view is not returning the correct data. It seems using for loop in the view is causing the issue since when I replaced the for loop with foreach loop it works fine. But I don't know if it is still true that sometimes the default model binder is unable to bind collection items correctly in foreach loop as described here. But since EF is returning the data correctly I'm going to close the issue and will open a new one related to using for loop in the view after doing some more investigation on my own. Maybe, it has something to do with using tag helpers with for loop, I'll investigate.

I know this is closed and old, but the solution to this is to add keys to your entity framework.  It is using the first column as key.


It keeps crashing because the config version needs to be 8 or later?

it keeps crashing because the config version needs to be 8 or later? I am dumb, I don't understand what that is telling me

Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install cloth-config, version 8 or later.
Unmet dependency listing:
- Mod 'Flower Map' (flowermap) 1.3.0 requires version 8 or later of cloth-config, which is missing!
at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:192)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:148)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
This the error

You need to install cloth config API v8 or higher (what ever is the newest for your current minecraft version). https://modrinth.com/mod/cloth-config


Required redirect_uris is optional in GUI

Expected Behavior
In Step 4: Run the sample.
The credentials provided in the credentials.json file is correct according to the structs. And I get the message Go to the following link in your browser then type the authorization code:
Actual Behavior
In Step 4: Run the sample.
I run the project and get
$ go run quickstart.go
2018/11/10 23:01:12 Unable to parse client secret file to config: oauth2/google: missing redirect URL in the client_credentials.json
exit status 1

The parameter redirect_uris is required in the code but it is optional in the GUI.
Steps to Reproduce the Problem

Copy the code into a go file.
Run the code go run quickstart.go and get

2018/11/10 22:56:52 Unable to read client secret file: open credentials.json: no such file or directory
exit status 1

Log into my google account and create a project without Authorized redirect URIs and Authorized JavaScript origins
Download the json file.
Move the json file next to quickstart.go
Rename the file to credentials.json
Run the code again go run quickstart.go
I get 2018/11/10 23:01:12 Unable to parse client secret file to config: oauth2/google: missing redirect URL in the client_credentials.json exit status 1
I then look into the json file less credentials.json. The parameters existing under web are client_id, project_id, auth_uri, token_uri, auth_provider_x509_cert_url and client_secret. No redirect_uris exists.

Specifications

Go version (go version go1.11 darwin/amd64)
OS (OSX 10.14.1)

These quickstarts (I'm not sure which one you are using) assume you are using an OAuth Client ID of type "Other", which includes the redirect URIs urn:ietf:wg:oauth:2.0:oob and oob. The button in the Quickstart instructions ensures that that the correct client ID type is created.
More generally, the authorization code flow will only work if the correct redirect URI is configured. It's optional in the UI since you don't need to use that flow, for example if using the client-side JavaScript client.


Iox #341 refactored error handling, condition lifetime in waitset

Signed-off-by: Christian Eltzschig<EMAIL_ADDRESS>

@elfenpiff could you maybe add a brief description of the changes? Would help with the review


Crashes on OutOfMemoryError, while there are 257 "OkHttp ConnectionPool" threads

We've recently migrated our app to OkHttp, and we've now getting several crashes for out-of-memory related errors.
Looking at the crashes we see hundreds of threads running at:
okhttp3.ConnectionPool$1.run (ConnectionPool.java:66)
The stack of the crash itself is:

Fatal Exception: java.lang.OutOfMemoryError: Could not allocate JNI Env
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:1063)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
at okhttp3.RealCall.execute(RealCall.java:60)
at MyActivity.myFunction(MyActivity.java:853)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

Shouldn't there be a limit on how many threads can OkHttp create?

You want to read this advice:
https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html

Thanks for the quick reply.
We were under the impression that builder() will return an existing instance, we'll get that fixed, thanks! 👍

@marmor7 Do you mean to say if we use builder() like following inside a method and call that method multiple times, each time a new instance of the client will be created and each instance will holds its own connection pool and thread pools?
public void doOpen() {
     // .....
     OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()
                // turn off timeouts (github.com/socketio/engine.io-client-java/issues/32)
                .connectTimeout(0, TimeUnit.MILLISECONDS)
                .readTimeout(0, TimeUnit.MILLISECONDS)
                .writeTimeout(0, TimeUnit.MILLISECONDS);
    // ...
    final OkHttpClient client = clientBuilder.build();
    // ...

@shobhitpuri yes, that's exactly what we did, and had ton of memory issues.
From the docs:

OkHttp performs best when you create a single OkHttpClient instance and reuse it for all of your HTTP calls. This is because each client holds its own connection pool and thread pools. Reusing connections and threads reduces latency and saves memory. Conversely, creating a client for each request wastes resources on idle pools.

Instead, we now have a single OkHttpClient that we build once, and is used by all methods.


Cannot type in MudDialog when openend by MudSelect event

Bug type
Component
Component name
MudDialog
What happened?
I have a MudSelect with the event SelectedValuesChanged opening a MudDialog. I cannot type in any TextField in this Dialog.
Opening the same dialog with a button will work fine.
Expected behavior
The newly openend MudDialog instance should be usable
Reproduction link
https://try.mudblazor.com/snippet/QuwnPwlMzRjfxAbC
Reproduction steps

Create MudDialog with Textfields
Create MudSelect
Open Dialog via MudSelect: SelectedValuesChanged
Textfield in MudDialog cannot be used

Relevant log output
No response
Version (bug)
6.11.1
Version (working)
No response
What browsers are you seeing the problem on?
Firefox
On what operating system are you experiencing the issue?
Windows
Pull Request

[ ] I would like to do a Pull Request

Code of Conduct

[X] I agree to follow this project's Code of Conduct

It works fine in the link provided in v 6.11.2
Firefox 120.0.1, Windows 11
Could you provide more feedback as to what exactly you are running?

Hi fondraco, thanks for getting back to me.
I messed up writing Firefox.
Actually I got the problem using Microsoft Edge 120.
You are right, in Firefox the example works without any issues.
I also tried it with Google Chrome and have the same issue there as in Edge.


Error with building boost 1.69.0, NDK 18.1

$ CFLAGS="" CXXFLAGS="" LDFLAGS="" ./build-android.sh /mnt/new/o01eg/android/ndk-bundle/
To follow build in another terminal, please use: tail -F /tmp/Boost-for-Android/logs/myst-log-2154.log
Building boost version: 1.69.0
Cleaning: boost_1_69_0
Detected Android NDK version 18.1
Building with TOOLSET=clang CXXPATH=/mnt/new/o01eg/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CFLAGS= CXXFLAGS=
Unpacking boost
Performing boost bootstrap
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr/lib/python-exec/python2.7/../../..
Unicode/ICU support for Boost.Regex?... /usr
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide:
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/doc/html/index.html

patching file boost/asio/detail/config.hpp
patching file boost/config/user.hpp
patching file boost/system/error_code.hpp
patching file libs/filesystem/src/operations.cpp
# ---------------
# Build using NDK
# ---------------
Building boost for android for arm64-v8a
Adding pathname: /mnt/new/o01eg/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build/feature.jam:491: in feature.validate-value-string from module feature
error: "none" is not a known value of feature <optimization>
error: legal values: "off" "speed" "space"
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build/property.jam:341: in validate1 from module property
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build/property.jam:367: in property.validate from module property
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/tools/features/variant-feature.jam:70: in variant from module variant-feature
/usr/share/boost-build/site-config.jam:9: in modules.load from module site-config
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build-system.jam:255: in load-config from module build-system
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build-system.jam:425: in load-configuration-files from module build-system
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/build-system.jam:607: in load from module build-system
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/tmp/Boost-for-Android/boost_1_69_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/tmp/Boost-for-Android/boost_1_69_0/boost-build.jam:17: in module scope from module

ERROR: Failed to build boost for android for arm64-v8a!
Done!

and same for other architectures and boost versions up to 1.65.1.

It looks like should be flag --ignore-site-config added to bjam call: https://stackoverflow.com/questions/23013433/how-to-install-modular-boost

After I've added this flags I could built 1.65.1 boost


Create dummy package for functorch

Soon, import functorch will work after one installs PyTorch. However,
we want to maintain backwards compatibility for installing functorch
from source (because many folks do that).
This PR:

deletes most of the code in functorch (which has already been
moved to the pytorch/pytorch repo)
sets up a "dummy package" -- installing functorch from source will
install something that has no imports. import functorch will work by
virtue of the functorch dummy package requiring torch as a requirement,
and the torch binary will enable import functorch.
leaves the README.md and some other necessary metadata (license,
CONTRIBUTING.md, etc) intact.

Test Plan:

I tested that one is able to build a dummy package and upload to
testpypi
We should test this in conjunction with
https://github.com/pytorch/pytorch/pull/83464

NB: the merge order looks something like:

turn off shipit sync to pytorch/functorch
merge stack at https://github.com/pytorch/pytorch/pull/83464
when https://github.com/pytorch/pytorch/pull/83464 hits the pytorch nightly binary, then merge this

https://github.com/pytorch/functorch/pull/1017 is the updated version


ContentSettings in storage blob makes empty string None

Package Name: azure-storage-blob
Package Version: 12.12.0
Operating System: Windows
Python Version: 3.9.6

Describe the bug
A clear and concise description of what the bug is.
ContentSettings in azure-storage-blob convents an empty string '' to None
https://github.com/Azure/azure-sdk-for-python/blob/0db0c16559023eec3140970b1e00b9eb12e1e0b4/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py#L714
To Reproduce
Steps to reproduce the behavior:

Create this class with content_type = ""
The class will be created with content_type = None

Expected behavior
A clear and concise description of what you expected to happen.
content_type == ""
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Hi @calvinhzy Zhiyi, thanks for bringing this up. I'm wondering if there is a use case where a customer would want content_type (or other ContentSettings) to be set to empty string? Rather than just not having them set at all?


Document multi-architecture support and how to tag images to make it work

Docker Engine will pull the image that's appropriate for the host that's pulling the image, based on tags. We should have a topic showing how to tag images so this happens transparently.
cf. Microsoft Azure Container Registry Manages Docker Images

@JimGalasyn  @mstanleyjones where to point or write this doc ?

Sorry, I don't understand the question you are asking. I think this would be a brand new topic.

@mstanleyjones , where should I put this document, I mean in which directory

@JimGalasyn  @mstanleyjones will it be useful (https://docs.docker.com/engine/reference/commandline/tag/) ? It tells how to tag an image with respect to the repository and version

#2944 should not be merged until the push support is merged into docker/docker.

@mstanleyjones what should I add more ?

@surajnarwade you can't add more but we have to wait for the feature to be finished. Right now the only way this works is some extremely vendor-specific stuff on our side.

@surajnarwade you will get the points though. :)

Docker Engine will pull the image that's appropriate for the host that's pulling the image, based on tags. We should have a topic showing how to tag images so this happens transparently.

This isn't entirely accurate. Any approach to use tags to dispatch the platform are purely by convention and typically unsupported on the docker engine. The approach described in #2944 is one taken by the arm community. Other approaches exist, as well.
Multi-platform images are pulled with something called manifest lists. These are specified here. The registry returns a content-addressable, verifiable json that points out to each image, annotating the pointers with platform information. This is supported today in the docker engine.
Assembling these multi-arch manifests is not supported today. Support for this in docker has been submitted in https://github.com/moby/moby/issues/27455 but still needs review to make sure this is the correct approach. Note that an external project exists, https://github.com/estesp/manifest-tool, but it is a proof of concept for wider support in docker, so I wouldn't recommend pointing people to this quite yet.
While understand the desire to get this out, I hope we take caution in our description of multi-platform support. The method that belongs in the docs must fit everyone's use case while at the same time be somewhat ubiquitous.

Closing this issue but leaving the associated PR open so we don't lose the work in progress.


How can I concatenate 2d and 3d tensors?

xseq = torch.cat((self.muQuery[y][None], self.sigmaQuery[y][None], x), axis=0)
This code tries to concatenate 2d and 3d tensors.
Can you explain how it works?
Thanks in advance.

How did you solve that?


Fixes macOS dock icon staying after break

closes #1307

I am having the same issue, When this is scheduled to be released?


Menu wrapping

When I narrow my browser window, there is a transition time when some of my navigation items move below the menu, and then they are light grey text on white, which is hard to see. Is it possible to have the black background of the menu go with it? Or have it increase in height when the window width forces this?

I little more of a squeeze and it all fixes for a tablet view. Very nice! :)

Because the nav is sticky, we dont want it to be more than one line high. Otherwise it will always take up a noticeable part of the page, and drop downs that overlap other drop downs create some weird problems for the user who is mousing over one but not the other.
We do have a setting in the customizer for adjusting the menu padding at the medium width, its under Menu Styles, looks like if you tweak it down and remove the duplicate "Home" menu item you should be able to make it all fit.

Excellent suggestion. Thanks! :)


readResource in class Crud

having follow your guideline implementing something like canViewXXX
i wrote a isUsers method in RuleTrait for checking corresponding role
i found:
    /**
     * @param ContextInterface $context
     *
     * @return bool
     */
    protected static function isUsers(ContextInterface $context): bool
    {
        $isUsers = false;

        if (($userId = self::getCurrentUserIdentity($context) !== null)) {
            $identity = self::reqGetResourceIdentity($context);

            $container = self::ctxGetContainer($context);
            $factory = $container->get(FactoryInterface::class);
            $api = $factory->createApi(UsersApi::class);
            $user = $api->readResource($identity);
            var_dump($user);
            $isUsers = $user !== null && $user->{User::FIELD_ID_ROLE} === RolesSeed::ROLE_ID_USERS;
        }

        return $isUsers;
    }

the var_dump($user) was not showing the user model, instead it show "NULL" as result.

@dreamsbond It might need some debugging from you. Are you sure you should use $userId instead of $identity?
    $user = $api->readResource($identity);

Also, if you want to check a property of the current user you don't have to load it again. It's already  loaded and accessible via
    $currentUserRoleId = self::ctxGetCurrentAccount($context)->getProperty(User::FIELD_ID_ROLE);

@neomerx
i will have a try on it ^^

after couple of trial.
confirmed the identity have proper returns.