Crash when repeating a lineout query

Rob Rieben can consistently crash the viewer when he is X11 forwarding (back to OSX) Data is on ocf @ /g/g24/cyrush/visit/issue00712 Here is how to reproduce: Open visit on ocf & X forward back to osx. Plot psuedocolor of mhd_ByAdd slice & set the normal to be zaxis at 50%From the Query window, execute a Lineout from 0 1 to 0 1Close the Lineout Windowexecute a Lineout from 0 -1 to 0 1 again, the viewer crashes. Here is the stack trace (deep in vtk, during font rendering - we may be ticking an OSX 11 bug) Stack Trace PC: 2aaab0230bfa, FP=7fffffffb620 ...rOpenGLEPKcPK17FTGLRenderContext, FP=7fffffffb640 ...rlayEP11vtkViewportP10vtkActor2D, FP=7fffffffb7d0 ...2D13RenderOverlayEP11vtkViewport, FP=7fffffffb820 ...2D13RenderOverlayEP11vtkViewport, FP=7fffffffb850 _ZN11vtkRenderer14UpdateGeometryEv, FP=7fffffffb8a0 ...tkOpenGLRenderer12DeviceRenderEv, FP=7fffffffb8b0 _ZN11vtkRenderer6RenderEv, FP=7fffffffb950 _ZN21vtkRendererCollection6RenderEv, FP=7fffffffb9a0 ...tkRenderWindow14DoStereoRenderEv, FP=7fffffffb9b0 _ZN15vtkRenderWindow10DoFDRenderEv, FP=7fffffffba60 _ZN15vtkRenderWindow10DoAARenderEv, FP=7fffffffbb10 _ZN15vtkRenderWindow6RenderEv, FP=7fffffffbb60 _ZN9QGLWidget6glDrawEv, FP=7fffffffbb90 _ZN15VisWinRendering6RenderEv, FP=7fffffffbc70 ...eQueryEPK14PickAttributesPK4Line, FP=7fffffffbe60 ...eryC1EP12ViewerWindowS1_P4Linebb, FP=7fffffffbec0 ...AddQueryEP12ViewerWindowP4Linebb, FP=7fffffffc010 ...rQueryManager15FinishLineQueryEv, FP=7fffffffc040 ...ubject22ProcessRendererMessageEv, FP=7fffffffc2a0 ...etacallEN11QMetaObject4CallEiPPv, FP=7fffffffc2d0 ...bject8activateEP7QObjectPKS_iPPv, FP=7fffffffc380 _ZN6QTimer5startEi, FP=7fffffffc390
-----------------------REDMINE MIGRATION-----------------------
This ticket was migrated from Redmine. As such, not all
information was able to be captured in the transition. Below is
a complete record of the original redmine ticket.
Ticket number: 712
Status: Pending
Project: VisIt
Tracker: Bug
Priority: Normal
Subject: Crash when repeating a lineout query
Assigned to: -
Category: -
Target version: -
Author: Cyrus Harrison
Start: 05/17/2011
Due date:
% Done: 0%
Estimated time:
Created: 05/17/2011 12:25 pm
Updated: 05/17/2011 06:43 pm
Likelihood: 3 - Occasional
Severity: 2 - Minor Irritation
Found in version: 2.2.2
Impact:
Expected Use:
OS: OSX
Support Group: Any
Description:
Rob Rieben can consistently crash the viewer when he is X11 forwarding (back to OSX) Data is on ocf @ /g/g24/cyrush/visit/issue00712 Here is how to reproduce: Open visit on ocf & X forward back to osx. Plot psuedocolor of mhd_ByAdd slice & set the normal to be zaxis at 50%From the Query window, execute a Lineout from 0 1 to 0 1Close the Lineout Windowexecute a Lineout from 0 -1 to 0 1 again, the viewer crashes. Here is the stack trace (deep in vtk, during font rendering - we may be ticking an OSX 11 bug) Stack Trace PC: 2aaab0230bfa, FP=7fffffffb620 ...rOpenGLEPKcPK17FTGLRenderContext, FP=7fffffffb640 ...rlayEP11vtkViewportP10vtkActor2D, FP=7fffffffb7d0 ...2D13RenderOverlayEP11vtkViewport, FP=7fffffffb820 ...2D13RenderOverlayEP11vtkViewport, FP=7fffffffb850 _ZN11vtkRenderer14UpdateGeometryEv, FP=7fffffffb8a0 ...tkOpenGLRenderer12DeviceRenderEv, FP=7fffffffb8b0 _ZN11vtkRenderer6RenderEv, FP=7fffffffb950 _ZN21vtkRendererCollection6RenderEv, FP=7fffffffb9a0 ...tkRenderWindow14DoStereoRenderEv, FP=7fffffffb9b0 _ZN15vtkRenderWindow10DoFDRenderEv, FP=7fffffffba60 _ZN15vtkRenderWindow10DoAARenderEv, FP=7fffffffbb10 _ZN15vtkRenderWindow6RenderEv, FP=7fffffffbb60 _ZN9QGLWidget6glDrawEv, FP=7fffffffbb90 _ZN15VisWinRendering6RenderEv, FP=7fffffffbc70 ...eQueryEPK14PickAttributesPK4Line, FP=7fffffffbe60 ...eryC1EP12ViewerWindowS1_P4Linebb, FP=7fffffffbec0 ...AddQueryEP12ViewerWindowP4Linebb, FP=7fffffffc010 ...rQueryManager15FinishLineQueryEv, FP=7fffffffc040 ...ubject22ProcessRendererMessageEv, FP=7fffffffc2a0 ...etacallEN11QMetaObject4CallEiPPv, FP=7fffffffc2d0 ...bject8activateEP7QObjectPKS_iPPv, FP=7fffffffc380 _ZN6QTimer5startEi, FP=7fffffffc390
Comments:

closing, since this is a rendering related crash and we have a totally new rendering stack since 2011


feat: add restart language  server command

Implements #328

cc @zth @cristianoc

Thank you @a-c-sreedhar-reddy. Loving the tiny size of the change!
@zth would you like to also take a look?

Thanks @zth @cristianoc @fhammerschmidt


[BUG] Readonly mode not working with AOT

When serving or build with AOT enabled, readonly mode is not working in mat-formio. It works well in bootstrap form io.

In my case the development build is working correctly, but in the production one the conditionals are not triggered.
I managed to solve this by using:  ng build --prod --aot false --build-optimizer false
It is a temporary solution and I hope that this issue will be solved soon..

This item has been resourced to a developer. We will let you know once this is issue has been resolved.

Thanks for your response. Awaiting the release. It's an awesome library that our project heavily relies on.


Twitter card image being overloaded by new social partial

Describe the bug
The change to the social partial in ./layouts/partials/head/meta is causing a second Twitter card and Open Graph image to be added to the meta section. Looks like the intent was to use the site logo if there are no defined feature, cover, or thumbnail images, but the reference to the images param has incorrect scope.
To Reproduce

Define "images" parameter in ./config/_default/params.toml that includes an image with feature in the name
Define a site logo in ./config/_default/params.toml
Build the site
The meta section will now include the  Twitter card and Open Graph images as defined in the images param, but also have Twitter card and Open Graph image metas using the logo image.

Ex:
<meta property="og:image" content="https://images.c20d.us/src/site-images/tweetcard-feature-image.png"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image" content="https://images.c20d.us/src/site-images/tweetcard-feature-image.png"/>
<meta name="twitter:title" content="Some post title"/>
<meta name="twitter:description" content="Some post description"/>
<meta name="twitter:site" content="@chalst"/>
<meta property="og:image" content="https://images.c20d.us/src/site-images/round-logo.png"/>
<meta name="twitter:image" content="https://images.c20d.us/src/site-images/round-logo.png"/>

Expected behavior
If a feature image exists in the images param, it should be the only Twitter card and Open Graph image defined in metas.
Hugo version:
hugo v0.92.2-CDF6A0D6 darwin/amd64 BuildDate=2022-02-11T14:17:39Z VendorInfo=gohugoio
Theme version:
hugo-theme-bootstrap-0.67.0
a8d1092a14830e6fd32092970a9b1f9102783a29 (HEAD -> main, origin/main, origin/HEAD) Update social.html
Additional context
Line 11 in ./layouts/partials/head/meta/social.html should be:
{{- if and (not $featured) (not .Site.Params.images) -}}
(".Site.Params.images" instead of ".Params.images")

Thank you.


Fix typo in example: s/query/q/

For the endpoint api/v2/sql the parameter to pass queries is q.
It is important to fix because it is in the SQL API front page. Thanks
@ibrahimmenem for spotting it.

PS: There are other examples related to Batch API that use a query parameter. I assume that's correct, though slightly inconsistent:
https://github.com/CartoDB/CartoDB-SQL-API/blob/dce803d04eade109326f23bb6c37aaace0f2c288/app/controllers/job_controller.js#L125

This PR fixes only the SQL API reference section (swagger file). The static main page should also be fixed


Feature/loadscreen ui 2.0

Description
Changed the loading screen flow to only connect client worker after the player clicks ready to connect.

So it looks like the connect buttons don't work - (Pressing spacebar does work fine though). I'm guessing something needs to be hooked up again?
Also, I don't think we have a transition to a 'Failed to connect' - the client seems to be stuck in connecting (If connecting fine to SpatialOS, but failing to spawn a player).


orders shifted

I am running a daily simulation on data i uploaded to zipline.
I am issuing an order on a specific date which i read through a feed file, however the orders i am issuing are being placed 2 days after i issue them (ie the first return computation is performed 2 days later).
For example i issue an order on the 18th of august 2015.
And i can see in the log file that the order is being issued on the 18th.

When i look at the transactions however:
perf.transactions
Out[806]:
2015-08-18 20:00:00                                                   []
2015-08-19 20:00:00    [{'price': 66.589, 'commission': None, 'dt': 2...
2015-08-20 20:00:00                                                   []
2015-08-21 20:00:00                                                   []
Name: transactions, dtype: object

The price shown in the transaction is the closing price on the 19th
When i check the daily returns im getting this:
perf.returns
Out[810]:
2015-08-18 20:00:00    0.000000e+00
2015-08-19 20:00:00   -1.000000e-07
2015-08-20 20:00:00   -2.799948e-03
2015-08-21 20:00:00   -3.489899e-03
Name: returns, dtype: float64

the first non zero return (-2.799948e-03) on the 20th is the return for the closing of the 19th to the closing of the 20th (ie the return from the closing 19th to the closing 20th).
There is no slippage and no commissions
set_slippage(slippage.FixedSlippage(spread=0.0))
set_commission(commission.PerShare(cost=0))

Hello @ikfdarba, thanks for posting this question. There are a couple of concepts that explain the results you are getting:

Order execution - When your algorithm places an order on a given bar, the order begins filling on until the next bar (regardless of the slippage model used). This way, the backtester guards your algorithm against lookahead bias.

In the example you shared, the logs show an order is placed on August 18th 2015. The transaction is then recorded on the next bar (August 19th 2015), which is when the order gets filled. This is consistent with the way Zipline handles order execution.

Returns - Algorithm returns are calculated as pnl / (total capital at start of period) (you can find the corresponding calculation here). This means that the very first time your algorithm shows returns the calculation will be (pnl for the day) / (starting capital).

Assuming you used the default starting capital ($10,000,000), the perf.returns you shared show the algorithm actually had a loss of $1 on 2015-08-19, after order mentioned above got filled.

The argument concerning the look ahead bias makes no sense if trading closing prices with an underlying data/bundle which consists only on daily bars. There has to be a mechanism to trade the current closing price of the current day.
Scenario: My data bundle only consists of daily price data, so no minute bars. The next bar is always the closing of the next day. I am facing the closing of todays stock and want to place an order on that specific closing price. This is realsitic an can be done in life trading scenario.

Concerning the look ahead bias: After the closing price is official, there is time left to trade with this closing price. After Hours Trading !

is the issue solved and is there a way to make sure trade executed same day?

is there any way we could reintroduce the instant_fill flag ?

One way to simulate instant fills is to create a custom slippage model that uses the previous bar's close price (or current bar's open price, instead of close) to fill incoming orders. Here is an example:
# Custom slippage model
class InstantSlippage(SlippageModel):

    def process_order(self, data, order):
        # Use price from previous bar
        price = data.history(order.sid, 'price', 2, '1d')[0]

        # Alternative: Use current bar's open, instead of close
        # price = data.current(order.sid, 'open')

        return (price, order.amount)

To use this slippage model, you would need to include set_slippage(InstantSlippage()) in your algorithm's initialize function. Keep in mind that orders would still begin filling on the next bar.
@frosk1 : Zipline does not support after-hours trading. I agree that running simulations with day frequency data exacerbates the difference between the price at which you place a trade, and the price at which that trade fills. However, using the closing price of the current bar to fill an order placed on that same bar does introduce look-ahead bias. Think about it this way: your algorithm uses the current bar's price for calculations, and then places an order. If the order were to fill at that same price, it would be as if your algorithm knew the fill price beforehand and incorporated that information on its calculations. This would introduce unrealistic performance in your simulations.
@a-camuto : If you would like to track instant_fill as a feature request, please open a new issue.
I am closing this issue since the original question has been addressed.


[layer_v2] Merge layer_v2 with main branch

This PR merges layer_v2 with main branch and brings main branch in-line with layer_v2.
After this match, layer_v2 will reset with main branch and all the layer_v2 must rebase with the reset layer_v2 branch.
Signed-Off-by: Parichay Kapoor<EMAIL_ADDRESS>

:memo: TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #1327. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://nnstreamer.mooo.com/.


Added blog: Reusability with export and import in Azure Bicep

Added my latest blog
Also PR number 100! ;-)

Awesome, I will mention that in our upcoming January build!

@johnlokerse , when you have some time, could you check the links that are failing the build?

It looks like some kind of browser user-agent issue. There's a new tool created that might fix this: https://github.com/gaurav-nelson/github-action-markdown-link-check?tab=readme-ov-file#--update-november-2023-
For now, we can do a workaround by stating that 403 is an "alive status code". What do you think about that @ElYusubov?

@johnlokerse please, give it a try when you have some time.
It would be nice to make the building work again.


Fix sigil invariance in :delete example

Thanks!

thanks @nbrown, I've invited you to the perl6 organization.


Should validator also send preflight OPTIONS request?

Related to #33, should the validator also send OPTIONS to potentially prime the way for the actual CORS request? Or does no system really take this into account? Or is this testing CORS and not IIIF?
Note that the spec and apache implementation note don't mention it.

Is this still necessary?


Background color

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
I can obtain only black and white background
Expected behaviour
I would change or remove the background color
Possible Solutions
card_mod ?
Mode
Both
Context / Reason
Hi! Great card! There is a way in order to change or remove the backgroud color of the card?

Hi. You can set this using card_mod. Just add the following to your config
card_mod:
  style: |
    ha-card {
      --ha-card-background: green;
    }


Implemented calculation of X. Called for W and Win to be made at clas…

…s init.
It's still not runnable yet, but it is getting fairly close. I just need to finish the train method that calls the other functions, and to compute the error on the validation set to return to the BO.

Got it to a working state

Codecov Report

Merging #1 into master will increase coverage by 4.7%.
The diff coverage is 95.12%.

@@            Coverage Diff            @@
##           master       #1     +/-   ##
=========================================
+ Coverage   63.22%   67.93%   +4.7%
=========================================
  Files           9        9
  Lines         446      527     +81
=========================================
+ Hits          282      358     +76
- Misses        164      169      +5

Impacted Files
Coverage Δ

parallel_esn/tests/test_esn.py
97.72% <100%> (-2.28%)
:arrow_down:

parallel_esn/esn.py
91.95% <92.59%> (+1.04%)
:arrow_up:

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 ff75af1...0972226. Read the comment docs.


[REQUEST] Uploading a compiled release for 0.4.6

I am unable to build the current 0.4.6 version of the plugin, also on the jetbrains.com website the latest version is 0.4.4 which doesn't work with recent Android Studio IDE version.
I checked the releases tab on the GitHub page but I only found source codes, any way to upload install-able .zip file in the releases section ?
Thanks

I am unable to build the current 0.4.6 version of the plugin

The plugin can be built with java 8 (I tried to building on java 10, and it was sad).
I normally use the Gradle wrapper to build the plugin. So ./gradlew clean buildPlugin normally does the trick. The zip is in the build/distributions directory.

The latest version is 0.4.4 which doesn't work with recent Android Studio IDE version

I am aware of this #17 . Android Studio is supported by an older version of the Material ui, something like ~1.6.1. Unfortunately, I forked it some where around +2.0. Which was not compatible out of the box with android studio.
It can be done, just need to put time into it. Currently trying to get the dark theme happy. You are welcome to give it a whirl.
Just for fun I linked a zip created from the hotFix branch
DDLC Theme-0.4.6.zip
Holler if you need more help! :)
PS, I did just publish a release. It normally takes Jetbrains like 2 days to approve the changes.

Thanks for the fast reply ! I thought that version 0.4.6 fixed the Android Studio compatibility, good plugin, keep it up 👍

Nope, sorry about that! I think that will be the next thing I pick up after the dark theme is completed. Thanks!
I'll close this after 0.4.6 is released though.

0.4.6 is available!
I will let you know when android studio is supported :)


Add Extension Icon support to block rendering

Splitting from https://github.com/LLK/scratch-gui/issues/815
Icon on blocks spec
This is a hi-res (300%) PNG for zooming on measurements. Extension Icons on blocks will need some special treatment when it comes to alignment and spacing.
In all cases the Vertical height of extension blocks will be taller than their "standard" block counter-parters. E.g. Command blocks with extension icons are 8px (2units) taller than a Command block without an extension icon.
Something to Consider
We will have similar needs to dynamically grow blocks vertically with "input first" blocks. Some languages reorder block parameters (e.g. Korean) and place inputs as the first element on a block. In these cases we will need to add addtional vertical padding so that the top notch does not overlap the input.

Input first blocks will still have the icon before the first input, right?  If so, the first input on an extension block will be past the notch (based on position of icon + bar).

Does the vertical bar get taller as the block gets taller?  For instance, in this block would the vertical bar's height be based on a distance from top and bottom, or is it a fixed height?

@rachel-fenichel - Thanks for the initial thoughts and questions.

Extension icons should always be the first element on extension blocks. So the "input first" stuff is not a real issue for anything that is an Extension.

Thanks for clarifying. No, the vertical bar does not need to get taller as blocks are nested. That can be a fixed height.

For a stack block with an extension icon, the icon is moved down by one grid unit from where it would normally be.  Does that one-grid-unit offset remain as the block gets taller?  E.g.

Spec:


UTC to local string converter

https://github.com/xamarin/XamarinCommunityToolkit/pull/1555

Thanks @LeoJHarris! Are you also actually going to write them? :)

Thanks @LeoJHarris! Are you also actually going to write them? :)

@jfversluis yup not a problem will try to do this soon 😊

Awesome, thank you! Let me know if you need any help!

Microsoft support for Xamarin will end on May 1, 2024 for all Xamarin SDKs including Xamarin Community Toolkit. In preparation for this, all issues and PRs in this repository are being closed.
.NET MAUI Community Toolkit is the replacement for Xamarin Community Toolkit and its documentation can be found here.


add normalizeFunctionName

Pull Request Test Coverage Report for Build 836

0 of 0   changed or added relevant lines in 0 files are covered.
10 unchanged lines in 1 file lost coverage.
Overall coverage increased (+0.01%) to 69.054%

Files with Coverage Reduction
New Missed Lines
%

dist/plugins/integrations/AWSIntegration.js
10
70.47%

Totals

Change from base Build 834:
0.01%

Covered Lines:
2652

Relevant Lines:
3590

💛  - Coveralls


[Feature Request] Improve expand selection

I guess that intellij idea IDEs ctrl-w/ctrl-shift+w use parsed tree...
Is it possible to improve vscode's expand selection by tree-sitter?
For example: expand selection for ruby is not fully supported in vscode.

Yes, this would be a logical feature.

It's absolutely possible, in fact it was one of the launch features in Atom 😉.


Add support for multiple ad units within a category for direct sale ads

Firstly, I love this package! You're my hero. It's saving me from so many wasted hours and headaches.
I have typical AdMob interstitial ads and a direct sale AdMob interstitial ad. The direct sale uses a different ad unit, but also has a very low fill rate as it is rate limited to one impression every 12 hours. As such, I'd like the following behavior:

Ability to set a list of ad units for any given service and/or format
Waterfall behavior where if the first unit fails to load, the next ad unit is attempted, and so on

Thank you Casey,We never felt the use of direct sale interstitial ad. But you’re welcome to update the package and create Pull request. We will take a lookOn Thu, 14 Mar 2024 at 4:26 PM Casey Rogers @.***> wrote:
Firstly, I love this package! You're my hero. It's saving me from so many wasted hours and headaches.
I have typical AdMob interstitial ads and a direct sale AdMob interstitial ad. The direct sale uses a different ad unit, but also has a very low fill rate as it is rate limited to one impression every 12 hours. As such, I'd like the following behavior:
Ability to set a list of ad units for any given service and/or formatWaterfall behavior where if the first unit fails to load, the next ad unit is attempted, and so on
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>


vue-router duplicates router-view contents when using prerender-spa-plugin

Version
3.2.0
Reproduction link
https://github.com/RudolfVonKrugstein/vue-prerender-test
Steps to reproduce
I am reporting this for vue-router, but I am not sure if it is really a problem with the vue-router component or some other tool in the toolchain I am using.

Check out the provided git repository, which has been created the following way

A new project has been created with vue create pre-render-test and setup with typescript and vue-router
Vuetify has been added using vue add vuetify
prerender-spa-plugin has been added and configured (see vue.config.js)

Build for production using yarn build
Run a simple http server, for example like this:
cd dist
python3 -m http.server
go to localhost:8000/about

What is expected?
The about page, just showing
This is an about page

What is actually happening?
The about page is duplicated:
This is an about page
This is an about page

Looking at the DOM I can see, that not the whole app is duplicated but only the contents of router-view.
It also seems that some unrelated changes to the project (like adding a toolbar) makes the problem disappear, or re-appear.
Maybe it is some sort of race condition?

I am reporting this for vue-router, but I am not sure if it is really a problem with the vue-router component or some other tool in the toolchain I am using.

For vue router bug reports we need boiled down reproductions (no TS, no vuetify). It could indeed come from something else, so please make sure it doesn't come from something else.
From vue-router perspective, router-view only renders one component, so it sounds more like something is rendering router-view twice

Is there any hint on how I could debug this? The router-view is not rendered twice, because it is in the 'static' main template. And I cannot reproduce it without vuetify/ts.

I'm experiencing a similar bug with the prerender plugin and <router-view> inside a <v-main> Vuetify component. When I remove <v-main> then everything works fine. But I still need that component so I don't know how to solve it.

@valentinoli did you try replacing <router-view/> with <router-view></router-view> and checking if the problem persist when rendering static content with spa-renderer?

Hi, in my case there was an error rendering the new view. After fixing the issues the duplication has gone.


org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join!

User{
@Id
@GeneratedValue
private Integer id;
private String name;
private String passwd;
private String telephone;
}
Profile{
@Id
@GeneratedValue
private Integer id;
private Integer userId;
private String name;
}
JPAQuery query = new JPAQuery(entityManager);
query.from(user).innerJoin(profile).on(user.id.eq(profile.userId));
Object result =  query.createQuery().getResultList();

.QuerySyntaxException: Path expected for join! [select user
from io.kindler.entity.User user
  inner join Profile profile with user.id = profile.userId]] with root cause

org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join! [select user
from io.kindler.entity.User user
  inner join Profile profile with user.id = profile.userId]

this issue is fixed?

Not all (versions of) ORMS support entitiy joins, leading to this issue. Its up to the ORM to support this. Entity joins are optional in JPA.


Support Android Library Modules

There is "Module Advice" from https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/issues/751.  Is there something to reuse there, or something small to do here?  🤔

The recommendation is to use @autonomousapps's https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin.  This kmp-readiness plugin is meant for a migration from kotlin("jvm") to kotlin("multiplatform").
This tool only scans dependencies in the runtimeClasspath configuration which is always available for kotlin("jvm")


⚠ Bofrost.de has degraded performance

In e50bb8b, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1406 ms

Resolved: Bofrost.de performance has improved in 731ea1e after 20 minutes.


Resource type specific restrictions for file and folder operations need to be implemented at the back-end level

Presently these restrictions are implemented at the front-end level only.

@pkdash Please be more specific. Obviously, the REST API will have to embody these restrictions. Are you saying that the primitive API requests upon which the REST API is based should understand the limitations, or should the REST API understand the limitations?

@alvacouch The primitive APIs should understand these limitations.

@pkdash Please note that some of my REST code intentionally bypasses the primitive APIs -- because it can -- and this limits the amount of coding I have to do, sometimes substantively. Limitations are instead coded directly into REST as overrides of generic Django REST class methods. This is especially true when the primitive API deals with a Django object instead of a file... but it is also potentially true in parts of the file/folder API, especially when manipulating the ResourceFile object.
In those cases, using the primitive API is a waste of time and I have -- accordingly -- not done that.
So, the fact that the REST API honors restrictions is not sufficient evidence that the primitive routines honor them as well.
In like manner, I have given some thought to solving this problem the other way, by replacing selected primitive API routines with their REST equivalents through the internal "Client" library, which for me would be an easier way to enforce these restrictions than by hard-coding them into the primitive routines...! This has virtually no performance penalty because the REST request is never made. Instead, the equivalent software is called directly without making a request at all. This is a Django recommended practice.
Ostensibly, the reason for this practice is that internal and external methods are prevented from disagreeing on limitations, which removes one potential point of failure.

@alvacouch

In like manner, I have given some thought to solving this problem the other way, by replacing selected primitive API routines with their REST equivalents through the internal "Client" library, which for me would be an easier way to enforce these restrictions than by hard-coding them into the primitive routines...! This has virtually no performance penalty because the REST request is never made. Instead, the equivalent software is called directly without making a request at all. This is a Django recommended practice.

Can you point me to some Django documentation to the above?

@alvacouch Here is the link you can refer to when implementing the rule enforcement in backend in the same way as done for the UI: https://docs.google.com/spreadsheets/d/1tc-6tIq_YkJpa2CGj5tAEHMaLOZV2i3W10lokBCJAn0/edit#gid=0

@hyi and @alvacouch
The folder operations should not be checked whether it is allowed or not at the backend the way the UI checks. I am guessing it has to be done using signals. For composite resource type, I am using a signal to validate what folder/file move/rename is allowed. This signal is fired from the move_or_rename_file_or_folder() prior to taking the actual action. Remember this also needs quite a bit of unit tests that need to be added to each resource type.

I am for making the actual limits as explicit as possible in the proxy classes. E.g.,
@property
def supports_folders(self):
return True
The default would be False.

@alvacouch
This is the way I am doing in file type (LogicalFile) by defining these type of properties.

@pkdash See the documentation on the Django "Client" library, which invokes a REST call without REST overhead. This is the call that is used to replace internal functions with REST functions, among other things. It completely bypasses the actual REST mechanics, and is thus suitably fast.

@pkdash @dtarb @mauriel133 @horsburgh
This is going to be a general theme in all REST programming in hs_core. Much of the application logic is encoded at the UI level. This is not limited to folders. The key problem is that the resource models have no concept of capabilities of each kind of resource, in the sense that things that should not be possible -- or should be possible -- are documented only in code and not in the data structure.
Somehow, I need a map of the UI logic and what it allows and does not allow. Otherwise there will be chaos.  A set of flags like the above -- edited into the various resource types -- would be a beginning.

@hyi In the referenced spreadsheet, what do YES(*) and YES(1) mean in the last column?

@alvacouch I believe YES(*) means the specific resource type allow one or multiple file upload with multiple file upload not in a normal sense. Specifically, raster and feature resource types allows to upload one zip file that contains multiple geotiff files for raster and multiple files for feature, respectively, in which the zip file is unzipped locally and extracted multiple files are added to the resource as appropriate. This is just my understanding, I am looping @horsburgh and @mauriel133 in to get definitive answer since they created that spreadsheet when doing UI work for folders.

@hyi @horsburgh @mauriel133 Another question about the spreadsheet: why would not keeping an extension be allowed?

@hyi @horsburgh @mauriel133 At first glance, preventing a resource from being zipped doesn't seem necessary. Why is this done?

@alvacouch @horsburgh @dtarb The spreadsheet was decided by the whole team. As I remembered, for some specific resource types, zipping is not preferable and they want to disable zipping. For extension renaming, I agree it is risky and probably better not to allow it, but apparently renaming file names are desirable, and it is hard to set up all the rules to determine which extension changes should not happen and which ones are legitimate, so the decision was, as I remembered, leave it to the user's discretion, as what is done by operation systems - extensions are allowed to be changes, but a warning will be presented to the user when extensions are changed.

@alvacouch, @hyi, and @dtarb - the functionality matrix is one of the biggest reasons why the folder interface took so long to implement.  Yep - there's a lot of resource specific logic there. We discussed that table as a group on the call and that's what @mauriel133 implemented. If use tells us we didn't get it right the first time, we can reconsider some of what is in that matrix.

@alvacouch and @hyi Wondering if this issue has been addressed?

@pkdash I think it has been addressed, but I may be wrong, so will leave it to @alvacouch to see whether it has indeed been addressed and can be closed.

This is a very complex issue that is only partly addressed. It is addressed enough for the purposes of release 1.10. It is not generally addressed quite yet. The main pain points have been coded, but there remain subtle differences between frontend and backend coding that have not been addressed.

The part that has been addressed is that there are now capability flags in the resource template that code part of the front-end logic that should be coded on the back end.
There are also other (small and subtle) states that are not addressed by these flags. This occur inside specific resource types.

I think I'll close this issue, as the main things are being handled, and open other issues for the subtleties, as needed.


Display number of suspended jobs

Adds the number of suspended jobs in front of the prompt, or nothing if there are none.
Example:
2 suspended jobs
2 ❯ ~

This is a really handy feature, thanks for the contribution! 💯


[QUESTION] About webhook timeout and analysisInterval on Blue/Green Deployment

I am curious with what is the problem if i set my pre-rollout webhook's timeout longer than the analysis interval since i checked on Flagger's webhook documentation that the sum of all rollout webhooks timeouts should be lower than the analysis interval.
I am trying to run some kind of test to the canary version and omit all kind of metric analysis , and the test usually takes between 5 and 15 minutes so i decided to use B/G deployment with this canary spec:
canaryAnalysis:
    interval: 2m
    iterations: 5
    threshold: 1
    webhooks:
    - name: "Functional Test"
      type: pre-rollout
      url: http://flagger-loadtester.dev/
      timeout: 10m
      metadata:
        type: bash
        cmd: "mytest.sh"

does this make sense at all? Because with this configuration, sometimes i encountered Halt pod-info.test advancement pre-rollout check Functional Test failed upstream connect error or disconnect/reset before headers. reset reason: connection termination which is unclear to me as to what caused this. I suspect that this is probably related with Analysis interval being lower than the webhook timeout.
Flagger version: 20.4
Flagger-loadtester version: 0.14.0

the sum of all rollout webhooks timeouts should be lower than the analysis interval

This doesn't apply to pre-rollouts hooks as they are blocking.
Are there any errors in the loadtester logs?

nope. Only this
{"level":"info","ts":"2020-03-26T16:16:20.235Z","caller":"loadtester/bash.go:32","msg":"command finished my-script.sh ","canary":"podinfo.test"}

Are you running this inside a service mesh?

yep. Sorry forgot to mention that i'm using Istio 1.4.0.
Also shorter-running command like exit 0 seems not affected by this error.
canaryAnalysis:
    interval: 2m
    iterations: 5
    threshold: 1
    webhooks:
    - name: "Functional Test"
      type: pre-rollout
      url: http://flagger-loadtester.dev/
      timeout: 10m
      metadata:
        type: bash
        cmd: "exit 0"

Ok so upstream connect error comes from Envoy, you should bypass the mesh for Flagger -> tester comms.

after adding excludeInboundPorts annotation to tester pod, i got this error instead:
Halt podinfo.test advancement pre-rollout check Functional Test failed Post http://flagger-loadtester.dev/: EOF","canary":"podinfo.test"}

anyway, Flagger is deployed in istio-system namespace without sidecar injection.
Do i need to move both flagger-loadtester and Flagger to the same namespace?

Hi @stefanprodan have you got the time to check this or tried to repro this issue? i found that it will return error when the task is running longer than a minute. When i tried to run sleep 59 on pre-rollout command it will passed the pre-rollout check.

@radiansatria I'll have a fix for you tomorrow

@radiansatria you can use weaveworks/flagger-loadtester:0.15.0

Hi @stefanprodan i have tried the fix but it's not working. It's still returning the same error. Did it work from your side?
{"level":"info","ts":"2020-03-30T19:56:46.986Z","caller":"loadtester/main.go:50","msg":"Starting load tester v0.15.0 API on port 8080"}
{"level":"info","ts":"2020-03-30T22:43:47.388Z","caller":"loadtester/server.go:216","msg":"bats command sleep 61","canary":"justice-iam-service"}
{"level":"info","ts":"2020-03-30T22:44:48.413Z","caller":"loadtester/bash.go:32","msg":"command finished sleep 61","canary":"justice-iam-service.demo"}

Flagger log:
{"level":"info","ts":"2020-03-30T22:09:45.873Z","caller":"controller/controller.go:258","msg":"Halt podinfo.test advancement pre-rollout check Functional Test failed Post http://flagger-loadtester.test/: EOF","canary":"podinfo.test"}

Hmm that's a different error than timeout

@radiansatria can you give this a try?  weaveworks/flagger-loadtester:0.16.0 I've tested it with:
    webhooks:
      - name: timeout-test
        type: pre-rollout
        url: http://flagger-loadtester.test/
        timeout: 70s
        metadata:
          type: bash
          cmd: "sleep 61 && exit 0"

Thanks! it's working now.


⚠ SceneTime has degraded performance

In 18a0ca5, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 1521 ms

Resolved: SceneTime performance has improved in f0b6712 after 6 minutes.


config stored in recording folder

In addition to storing the config here, the post processor will also pull the config stored here to create the 3d reconstruction

Post-Processing Tab: The post-processing tab should display the config file from the recording directory, not the main directory. This change is needed to ensure that the appropriate config file is used during post-processing.


python3Packages.opencv4 missing the UMat type

Describe the bug
When trying to access GPU acceleration from OpenCV's python bindings, the UMat type does not exist, even though OpenCV is clearly built with OpenCL support and the OpenCL runtime is detected correctly by opencv_version --opencl
To Reproduce
Steps to reproduce the behavior:

nix-shell -p python3 python3Packages.opencv4 --run python3
import cv2; help(cv2.UMat)

Expected behavior
The documentation of the UMat class is displayed
Actual behaviour
AttributeError: module 'cv2' has no attribute 'UMat'
Metadata

system: "x86_64-linux"
host os: Linux 5.7.4, NixOS, 20.09pre231796.22a81aa5fc1 (Nightingale)
multi-user?: yes
sandbox: yes
version: nix-env (Nix) 2.3.6
channels(root): "nixos-20.09pre231796.22a81aa5fc1"
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: python3Packages.opencv4

The problem might not be limited to OpenCL, yes. I have not tested with other backends so can't say for sure though.

I found the problem at this line:
https://github.com/NixOS/nixpkgs/blob/13a3e5023192b62d6c5662c37549d8bb9e5e6a28/pkgs/development/libraries/opencv/4.x.nix#L175
The patch causes modules/python/src2/gen2.py to skip over modules/core/misc/python/shadow_umat.hpp which contains the actual definition of UMat used by the Python bindings. I commented out that line and everything works now. It appears the original issue #26304 mentioned in the comments was fixed another way in the meantime as enableContrib = true builds and works too.
I'm not sure of the overall implications of just removing this line. Maybe an exception for that specific file should be added instead? By the way, the 3.x version has the same problem and solution.
Maintainers, do you have any input? I can submit a PR to just cut out that line. @mdaiter @basvandijk


feat(#54): parametrized path in latex.rs

closes #54

PR-Codex overview
This PR focuses on updating the template function to accept a &Path instead of a &str, enhancing type safety. It also introduces the parameterized crate for testing.
Detailed summary

Added parameterized crate dependency in server/Cargo.toml.
Updated documentation in server/src/report/latex.rs to reflect changes in template.
Changed template function signature from &str to &Path.
Modified test function to use Path for better parameterization.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@rultor merge

@rultor merge

@h1alexbel OK, I'll try to merge now. You can check the progress of the merge here

@h1alexbel Thanks for your contribution! You've earned +4 points: +4 base, -16 for no code review, -4 for only 3 comments (policy requires at least 6), and +20 to meet the minimum 4-point reward. Remember, code reviews and more comments can boost your points significantly. Your running balance is now +55. Keep the quality contributions coming!


[QUERY] [Service Bus] Guidance for retrying with transactions

Library name and version
Azure.Messaging.ServiceBus 7.17.1
Query/Question
I am aware that retrying individual operations when in the context of a wider transaction is not possible due to this.
My question is, how should we handle transient errors whilst in a transaction?
Would the recommended way be to retry the whole transaction? Something like:
var retryAttempts = 0;

while (retryAttempts < 3)
{
    try
    {
        using var ts = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled);

        await Task.WhenAll(
            args.SetSessionStateAsync(...),
            args.CompleteMessageAsync(...)
        );

        ts.Complete();
        return;
    }
    catch (ServiceBusException e)
    {
        if (!e.IsTransient)
        {
            throw;
        }
    }

    retryAttempts++;
    var retryDelay = Math.Min(Math.Pow(0.8, retryAttempts), 60);
    await Task.Delay(TimeSpan.FromSeconds(retryDelay));
}

// TODO Should probably throw the ServiceBusException if max retries has been exceeded

If not, what would be the recommended way?
In any case, could the documentation be updated to cover this, maybe an example added here?
Environment
No response

Whether or not to retry the transaction would be highly dependent on the application scenario, but if you do want to retry then yes, you would need to retry the whole transaction since it will either succeed or fail as one atomic unit.


Rename provider should support to 'resolve' rename location (to expand, invalidate, etc)

VSCode Version: 1.2.0
OS Version: Windows 10

I’m having trouble with getting VS Code to do a rename operation correctly. When I put the caret on the word I want to rename and I hit F2, I see this:

However, if I do the same operation (F2) on a simple string, I get just the contents I expect:

It look like rename is using the css word rule to determine the word at the location. This doesn't work well with structured content inside string on which this rename wants to work.
Maybe the rename support should be able to tell what range is modified?

It makes sense to me that if there is a selection, the rename operation should apply to the entire selection. If there isn't a selection, then the rename should apply to the word that the caret is currently inside of.
An even better option (in my opinion) would be to add a new provided named RenameRangeProvider that could be registered to tell VS Code what range to rename given the current selection.

@daschult I what language do you see this? As in many other places we rely on the word definition each language can contribute. Under the hood rename is a positional operation and doesn't mind what the current word is - it's only to populate the UI

This happens in a JSON file.

Closing as we only have the word definition so expand the a selection into something more meaningful. This doesn't affect how the rename feature works.

@jrieken I think we should reconsider. Marking this 'as designed' says we don't support renames embedded languages.
The initial word is important for the user to understand what is renamed. In this example showing the wrong word will completely confuse the user and the user will never use the refactoring. The word rule of the host language can not be used here. What if the rename provider can override the word rule? Maybe provide range for a offset. Normally there's just one rename provider for a position. Not sure if we support multiple rename providers for the same positions, I guess we would need to pick one (or what happens if there are two and both make changes to the same documents and even locations?)

we don't support rename for embedded languages.

Why? The editor always uses the word rule of the corresponding mode, so I don't see why we would not support that? Actually, we did support it already with the 'old world'

reopen since @aeschli is very passionate about this

Also the old world would not support that scenario. The JSON mode can not (and should not) know what's the language inside the string literal. Maybe one day we will have a mechanism where we we can express embedded languages ranges.
But in this case, we don't need the full embedded language story. The current providers do to a great job of letting the Azure extension add all the supports they need. If they could also tell us what they intend to rename, then we can properly initialize the rename box.

I'd also love to see some improvements here. I can't merge our rename support currently because of incompatibilities with how Code does rename and how our language server does; it results in very unexpected behaviour.

It'll be hard to convince the Dart team to remove this functionality (it is useful, adding an alias to something that doesn't yet have one, for example) but there's no good way for us to fix this without starting to parse the Dart ourselves and then just skip the rename if it's something that doesn't match the cursor exactly (though it'll still leave weird behaviour where the user is allowed to enter a new value over "import"!).
Some ideas:

Allow the provider to state whether the value under the cursor is valid for rename
Allow the provider to provide the text to be pre-populated for the rename

I think 2 would be best - in the case of import "dart:html"; with cursor in import we can pre-populate with empty string, but in import "dart:html" as foo; also with cursor on import we could pre-populate with foo. These would need changes to the language service, but they feel like better changes all around.

May I also request that if this is implemented such that we can return the text to pre-fill in the box (or reject the request to rename) that it supports returning as a Promise? (I suspect you'd do it this way anyway, but I can only get this value asynchronously from the language service).

I also like the idea of the language server letting VSCode know what text to be pre-filled in the rename box based on the position of when the rename was invoked. It would also help if we could accept or reject a rename request based on the position.
Right now I am finding it hard to let VSCode know when and what to rename.
Any estimate on when such feature will be implemented in VSCode?

from @DanTup in https://github.com/Microsoft/vscode/issues/45384

There's a new RenameProvider API coming to allow us to resolve the initial value in the rename box. It'd be good if we could also provide a validation method, so the box can go red if the user types characters that are not valid here in our language (similar to the window.showInputBox).

I wonder if we can do this all in one call or need a separate API method...

Do you mean bundling it with the request to actually get the edits? I think the validation would be significantly cheaper than the actual refactor (which might span many files), so asking for full edits on every key press might be excessive?

Do you mean bundling it with the request to actually get the edits

No, I mean to use the new function this issue will introduce. Today, it used to determine the range that is being renamed, so before but not while showing the input widget. However, we could make it such that it constantly checks. E.g the first invocation during a rename session will be empty and a provider can fill in the range to be renamed or provide an error, e.g. when renaming a keyword etc. Subsequent request will send the new name (as typed) and the provider can validate that

Ah, so you mean to add a new argument to resolveInitialRenameValue to pass the current value back in? If so, can you pass the whole  previous RenameInitialValue and not just the text, so we can skip re-calculating the range and just do the validation (for me the validation is likely client-side but for the range I need to go over to the server)?

Yeah, something along those lines

the editor provides a default context (using the word and word range at the position)

We need to ensure that we can always control the first thing populated in the box and it's not guessed by Code, as in some cases what Code would pick is incorrect. For ex:
import "mything.dart" as a;

In the dart language server, invoking rename on the whole line will rename a so we'd want it to be pre-populated with a that even if the user pressed F2 while the cursor was in the filename.
In the validation, we also need to be able to report a string back to the user about why it's invalid. For example it might be because they've typed invalid characters, but it might also be that the name they're typed is already in use.
It's not clear from the API you posted how validation errors would be reported?

We need to ensure that we can always control the first thing populated in the box and it's not guessed by Code, as in some cases what Code would pick is incorrect

I do :+1: this requirement - providing some initial context is the main use case for us at the moment (and it's reflected by current implementation, I guess).
I think some kind of generalization would be OKish but we need to know if it's initial call of the function or some next call. Maybe context could be RenameContext | undefined for example? (with undefined for first call).
On the other hand I believe it would lead to something like:
if context == undefined then
   doSomething
else
  doSomethingTotallyDifferent

which kinda suggest that we try to put 2 unrelated things into one function.
What about keeping those 2 things separated? Keeping function to provide initial context as is right now and adding new API for validation (and I agree with @DanTup - if we add any validation API for renaming there must be some way to return error message and give feedback to user, not just silent failure)?

If we get an undefined context on the first call, we wouldn't have the range which we need to figure out the initial text to populate with?
I do think keeping them separate might be easiest - a resolve that lets us provide the initial text and then a validate that lets us validate and return an error message. Trying to put them into one I think will make the API more confusing to implement (also, if separate they could individually be optional which might make sense?).

In the dart language server, invoking rename on the whole line will rename a so we'd want it to be pre-populated with a that even if the user pressed F2 while the cursor was in the filename.

I'd argue that rename should only work on empty selections and not jump to next best fit - when resolving a range from a position we will definitely check that the original position is contained in the returned range.
Yeah, maybe we should keep resolving and validation separate for now despite the overlap in them. Another idea (VS with Roslyn does that) is to call provideRenameEdits while the user is typing and reuse the validation from there...

I'd argue that rename should only work on empty selections and not jump to next best fit - when resolving a range from a position we will definitely check that the original position is contained in the returned range.

It's not jumping to the next best fit, it's doing the thing that it believes is logical. For example if I hit F2 on the word class of class Danny it's highly likely that I want to rename the class and not try to change the keyword. What's the reason for wanting to block this? (it comes in really handy, for ex. you can F2 on an import that doesn't have an alias, and the rename gives it an alias, while updating all of the existing code that calls it to use it).

What's the reason for wanting to block this?

Because it might lead to confusion, think of a provider that returns a range many line below/above the current position.

can F2 on an import that doesn't have an alias, and the rename gives it an alias, while updating all of the existing code that calls it to use it

Can you elaborate on that? Is this a code-action use case? What do I rename when there no alias yet?

Because it might lead to confusion, think of a provider that returns a range many line below/above the current position.

But surely that can only mean one of two things:

The provider has better context and is providing a feature (as in our example)
The provider is buggy or implemented to do something confusing

I don't think you should be trying to work around 2 because if the provider is buggy they could give you a valid range but then return nonsense edits anyway - the provider has to be responsible for their own bugs and you shouldn't block functionality in an attempt to stop them (or if you do, at least gives us a flag to override it).

Can you elaborate on that? Is this a code-action use case? What do I rename when there no alias yet?

The difference between "renaming alias a to b" and "adding an alias as b` is fairly minor IMO. It would be a shame to have a different workflow (making a lightbulb always appear and then showing our own input box to get the name). Here's a more specific example:
import "dart:io" show a, b, c, d, e, f;

That list of things I'm showing is getting quite long, so I decide I just want to change this to:
import "dart:io" as io;

The dart analyzer allows me to hit rename on the string "dart:io" and tell it to rename to "io" and it would automatically add as io.
Forcing the returned range to span where the cursor is means we can't provide functionality like this. Yes, we could provide another command to do it, but it seems like an arbitrary restriction providing no real benefit.
Similarly, if this was supported and you hit rename in the string class Danny but with the cursor in class but the textbox appeared with Danny pre-filled, it would absolutely not be confusing to the user - they would know exactly what will happen when they change it and hit enter. It's a convenience with (IMO) no drawbacks.

I understand the cla|ss Foo use-case and we can think about allowing to stay on the same line but jumping around isn't the right thing to do and also not the right thing to ask providers to implement - we provide the current position for a reason.
The scenario you describe is a prime sample for a code actions and you cannot expect us to optimise rename for that scenario. You can expect us to improve code actions, e.g. code actions that require input, code actions that are triggered via the Hint-severity etc.

but jumping around isn't the right thing to do

I'm not asking to support "jumping around" - my cases are likely all on the same line too.

and also not the right thing to ask providers to implement

I'm not suggested providers are asked to do anything like this. I'm just asking that a provider can return a range that doesn't include position if they deem it a good feature.

The scenario you describe is a prime sample for a code actions and you cannot expect us to optimise rename for that scenario

I'm not asking you to optimise for it, I'm just asking that you don't block it with a rule that I don't think is adding any benefit. There are ways around it (we could just expand our range to include the whole line, since it's us doing the edits anyway), it'd just be nice if we didn't have to fight the API unless there's a good reason.

You can expect us to improve code actions, e.g. code actions that require input, code actions that are triggered via the Hint-severity etc.

I'm just trying to avoid working against my language service. It provides this (IMO, very nice) functionality that beyond what's expected with renames but I can't expose it to my users (and may have to do work to detect when I can't do it). I don't understand the advantage to disallowing it :(

Because it might lead to confusion, think of a provider that returns a range many line below/above the current position.

How this is different than any other existing API that can do something "silly" or unexpected? I can write completion provider that inserts "HERE BE DRAGONS" string in random place in the file additionally to normal completion. I can write rename provider that do random changes instead of "correct" renaming. Every API that you expose can be "abused" and lead to confusing behavior - and I don't think it's a problem of editor or API, but particular extension.
Anyway, in case of F# extension, we need providing initial context to provide range that expands around range suggested by editor (https://github.com/Microsoft/vscode/issues/32762) so situation is bit different than the one @DanTup describe, also, as far as I remember for current implementation range in context is used just to get text that's put into the rename box - not to move rename box itself.

I can write completion provider that inserts "HERE BE DRAGONS" string in random place in the file additionally to normal completion

Good example because we actually check that the main edit of a completion item happens on the same line. Sure, extensions can always do whatever they want but not always with API-blessings.

Good example because we actually check that the main edit of a completion item happens on the same line

But you can provide additional edits that can do anything ;-)
Anyway, I do understand why you want to limit functionality. And I do agree that jumping rename box can lead to confusing behavior. However I think the case that @DanTup describes seems plausible and potentially useful/possible to implemented for different extensions. Maybe limiting this to same line would be good middle ground?

And I do agree that jumping rename box can lead to confusing behavio

To be clear, I wasn't asking for the rename box to move at all. I just want to be able to rename something did not span the cursor position. If required, I'll just sent a fake edit for what's at the cursor position and then put the real rename into the other edits. It just feels like a really strange restriction (unless ofc, it was entirely because of moving the input box - which I don't want).

Maybe limiting this to same line would be good middle ground?

Yeah, that's something I am OK with. The flow will be that the user hits F2, we make the resolve-request, and then open the widget. So we shouldn't be too far away from the cursor, e.g. no horizontal scrolling required.

I have branched off the validation of a rename context, e.g new name, for now. This is what @aeschli and I have agreed on

	export interface RenameContext {
		range?: Range;
		newName?: string;
		message?: string;
	}

	export interface RenameProvider2 extends RenameProvider {

		/**
		 * Optional function for resolving and validating a position at which rename is
		 * being carried out.
		 *
		 * @param document The document in which rename will be invoked.
		 * @param position The position at which rename will be invoked.
		 * @param token A cancellation token.
		 * @return A `RenameContext` with more information. The lack of a result can signaled by returning `undefined` or `null`.
		 */
		resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<RenameContext>;

	}

I'm assuming that range will be used for placement of the input box and newName is the default text to put in it, but what's message used for?

When message is set rename will be blocked, a sample would be "Cannot rename this element". The range property determines the box position and preselection which again newName overwrites

There is a push to keep this more simple, so that a rejected-promise is replacing the message-property and then there a double of newName being useful, e.g. the rename-input-box should be populated with the value in range. That would reduce the proposal to something like this:
resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range>;

@jrieken I don't think that'll work for me with the current language server API - when I send a rename, the range I get back is for more than just the token being renamed (eg. in the case of import "myfile.dart" as alias; a rename on alias gets back the whole import directive).
If you want a simple value, being able to provide the original text is more important to me than the range (in the cases where the item to be renamed is not directly where the rename is invoked, it's always close enough - leaving the input box where it was invoked then renaming something a few characters down the line seems fine to me). I don't know if that's the same for others though.

@DanTup I understand your scenario but what you are trying to achieve it's not really rename but a code action. As said, I am happy to help on that too. For instance the showInputBox-api can be enhanced to show an input box in the context of an editor.
So, back to rename. What would be the use-case for suggesting a name that's different than the selected text? Are there language services that suggest meaningful names, iff so which?

I understand your scenario but what you are trying to achieve it's not really rename but a code action

I'm not sure if we're talking about the same thing. I'm talking about the following code:
import "myfile.dart" as myprefix;

I am invoking rename on myprefix. That seems like a rename action, not a code action? The problem is my language server returns the whole line as its range (along with the text myprefix). From this information, I can't reliable give you the range of the text.
What's the advantage to us giving a range and you looking the text up in the document versus us just giving you the text?

What would be the use-case for suggesting a name that's different than the selected text?

How about if I hit F2 on the word class from class Danny? Why shouldn't that perform a rename of the class? It's almost certainly what the user intended.

Are there language services that suggest meaningful names, iff so which?

I don't know; but I think it'd be confusing if they did and it was pre-filled. Imagine you have class named fred but your language server is of the opinion it should be named Fred.. it'd look a bit weird if you hit F2 and it was pre-filled with that (to the point where it might feel like a bug).

@jrieken I quite agree with @DanTup. The language server should be able to provide the text to be populated in the rename box. We in Gauge too are looking at a rename provider that would allow us to provide the text to be populated in the input box.
Here is my use case.  In Gauge we let users write their code in Markdown. While using markdown, some of these steps can span multiple lines. An example piece of code is as such.
# Specification
* A sample step with some params
    |col 1| col2|
    |one  | two |

Invoking rename on line * A sample step with some params should the lines 2, 3 and 4. We understand that showing a box spanning three lines can be quite confusing. So, we would like to show the signature of the code instead. In Gauge, the lines 2, 3 and 4 can be denoted by the text A sample step with some params <table>. Showing such a text in the input box would be more intuitive to the users, as the user can be sure as to what they are trying to rename.

I am invoking rename on myprefix. That seems like a rename action, not a code action? The problem is my language server returns the whole line as its range (along with the text myprefix). From this information, I can't reliably give you the range of the text.

Yeah, that looks like rename. However, if the language server returns the whole statement and not the identifier to be renamed. why use it? It seems that the information is just not suitable and that you would be happy with the current default.

How about if I hit F2 on the word class from class Danny? Why shouldn't that perform a rename of the class? It's almost certainly what the user intended.

The proposed API can do that, but the range must be the identifier that's to be renamed not more.

it'd look a bit weird if you hit F2 and it was pre-filled with that (to the point where it might feel like a bug).

Yeah, we see it like that as well and therefore have concluded the simple api (map a position to an identifier-range) is enough.

So, we would like to show the signature of the code instead. In Gauge, the lines 2, 3 and 4 can be denoted by the text A sample step with some params . Showing such a text in the input box would be more intuitive to the users

@nehashri In your same what are the identifier that are to be renamed? The arguments one and two. What is the function name? Why do want to show a signature when renaming a symbol?

However, if the language server returns the whole statement and not the identifier to be renamed. why use it? It seems that the information is just not suitable and that you would be happy with the current default.

Because it relies on Code's default always being correct and since it doesn't understand the semantics of the language it's likely to result in edge cases and bugs being raised. I already have to reject a bunch of renames and display "This rename is not yet supported" to my user when I detect bad renames happening (for ex. if the user hits rename on class of class Danny), though admittedly I don't know if there are any cases that I could strongly argue are valid (I think hitting rename on class should work, but I'm biased because my language server handles this :-))

How about if I hit F2 on the word class from class Danny? Why shouldn't that perform a rename of the class? It's almost certainly what the user intended.

The proposed API can do that, but the range must be the identifier that's to be renamed not more.

I can certainly request that my language server adds a property, but they also have a huge backlog and it's likely to be a long time before I was able to use it. Since you're adding a new API anyway, it seems that just letting my specify the text is relatively minor and would allow my users to get much better renames much quicker. I'm happy to do whatever work I need to in my extension, but it'll be a shame if users have to wait even longer - it's already been a very long time since this was first request and it's a bit weird that I have to explain these rename issues to my users :(
Other than a marginally simpler API, what is the advantage of not allowing us to provide the text? There seem to be many drawbacks. Providing the text seems far more useful than providing the range so if you only want one item in the API, why can't it be that?

I understand that; but it's not like it's a completely unreasonable or totally-specific-to-my-language-server change; it seems like a nice feature to let the language server provide the text and a relatively small tweak. Without it, Dart and Flutter users will continue to have a worse experience in VS Code than IntelliJ and Android Studio :-(

but also not a blocker

I don't understand the last line. It seems blocking if we can't pre-fill the box with something that will work? Putting class Danny into the box would not be a valid rename.

@jrieken  In Gauge each line/step in Markdown is mapped to a method signature. In the above example, the lines
* A sample step with some params
    |col 1| col2|
    |one  | two |

is similar to a function call with parameters. The signature of the function being A sample step with some params <table>. The parameter <table> gets the value
|col 1| col2|
|one  | two |

In this case rename would span more than one line. Hence, showing the signature would be more useful.
Also, let me give you another example where showing the signature is more useful to us.
In Gauge, we can make a function call with parameters. ex:-
* Number of vowels in "apple" is "2"

In the above example is a function call to the function with signature Number of words in <word> is <numberOfVowels>.
There are two parameters in the function, word and numberOfVowels. Unlike other programing languages, since we deal with natural text, there is no specific place where the parameters can appear. Hence, we have to show the whole line for rename. But the user must be allowed to rename the function name, but not the parameters.
There are many more situations where showing the function signature has proven to be more intuitive the users. We would like to allow for a similar experience to the users in VSCode. So, we would like to show the function signature instead of the  line.

The user must be allowed to rename the function name, but not the parameters.

So, the name of this function is the whole signature? So, Number of words in <word> is <numberOfVowels>. and when hitting rename anywhere in that string you want populate the rename input box with that whole string?

@jrieken Yes, I would like to populate the rename box with the whole string i.e., Number of words in <word> is <numberOfVowels>.

Ok - that should work with the proposal. Your provider would then return the range of the statement and the box would be populated with the text in that range.

@jrieken Thanks for change, that would help us a lot :)

@jrieken Sorry, if I misunderstood your statement yesterday. You mean that only the range will be provided. To be correct, my range would have the text Number of vowels in "apple" is "2". but I would like the input box to be populated with Number of words in <word> is <numberOfVowels>.. So, when you say that it would work with the proposal, what do you mean?

populated with Number of words in  is .. So, when you say that it would work with the proposal, what do you mean?

Yeah, you won't be able to do that. In your sample, assuming I can replace values with arg-names, what happens if I 'rename' things to: Number of words in <word>. (removing an arg) or Number of words in <word> is <blablabla>. (renaming an arg)? Is that allowed and supported?

@jrieken That should be upto the language server to handle it. In our case, we may invalidate the new text or fail to rename with an appropriate message. I am not sure why you are worried about that here.
We have actually implemented rename in other IDEs by provided the text to be renamed and its worked quite well for us. So I don't think you worrying about how such edge cases is handled is important.

Ok, apparently the behaviour I'm seeing with my language server is a bug. In most cases it does actually return the range for the symbol.
So, I'm going to take the range provided by my server and read that part of the document and see if it matches the oldName variable they provided me. If they do, then all is good and I will pass that range to Code and if it does not then I will reject the rename. This will allow all cases where I have reliable info to work (which should be everything once the bugs are fixed) and no cases where the user will get the wrong thing in the box.

In our case, we may invalidate the new text or fail to rename with an appropriate message. I am not sure why you are worried about that here.

Invalidation is what I would have expected. I guess what I fail to see is the importance of showing <word> instead of "apple". Isn't it all about substrings that must not be changed (no matter if they are printed as argument names or variables)?

@jrieken That is one of the problems. As I said initially, we have function calls that span across lines. In the example I provided initially,
* A sample step with some params
    |col 1| col2|
    |one  | two |

The text that should be populated in the box should be
A sample step with some params <table>

instead of
A sample step with some params
    |col 1| col2|
    |one  | two |

In this case what do you expect us provide the range as? Providing only the first line as the range would mean incorrect/partial data in the input box. Providing the multiple lines can be confusing to the user.

Hm, I understand

This is what we are shipping with as stable API (last chance for feedback):
	export interface RenameProvider {

		/**
		 * Provide an edit that describes changes that have to be made to one
		 * or many resources to rename a symbol to a different name.
		 *
		 * @param document The document in which the command was invoked.
		 * @param position The position at which the command was invoked.
		 * @param newName The new name of the symbol. If the given name is not valid, the provider must return a rejected promise.
		 * @param token A cancellation token.
		 * @return A workspace edit or a thenable that resolves to such. The lack of a result can be
		 * signaled by returning `undefined` or `null`.
		 */
		provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit>;

		/**
		 * Optional function for resolving and validating a position *before* running rename. The result can
		 * be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol
		 * which is being renamed - when omitted the text in the returned range is used.
		 *
		 * @param document The document in which rename will be invoked.
		 * @param position The position at which rename will be invoked.
		 * @param token A cancellation token.
		 * @return The range or range and placeholder text of the identifier that is to be renamed. The lack of a result can signaled by returning `undefined` or `null`.
		 */
		resolveRenameLocation?(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Range | { range: Range, placeholder: string }>;
	}

This looks perfect to me - did I miss that this was already in insiders?

The API's look good. Any idea when these requests will be supported through the language server protocol?

@dbaeumer will know

LGTM 👍

I opened https://github.com/Microsoft/language-server-protocol/issues/455. As always a PR helps to speed this up.

@jrieken Is there a way to call resolveRenameLocation from tests?

oh! there actually is something wrong! great catch

@jrieken Cool; it didn't seem like there wasn't much I could've done wrong. I did scan through the code, but obviously not that bit! I'll try again after next insiders build, cheers!
Btw, any comments on the testing? Currently I use vscode.executeDocumentRenameProvider for testing the rename, but can't see how I could test the resolve is working (I'd like to have tests to ensure I'm mapping to expected locations and getting expected placeholders).

@jrieken I just updated Insiders now, and this still doesn't seem to hit my resolve method; can't figure out what I'm doing wrong? Hitting F2 just opened the box as it used to with the "closest word" pre-filled, and if I press enter calls my provideRename method. Breakpoint in resolveRenameLocation wasn't hit.
My packages.json references VS Code 1.23 and I've nuked both node_modules and out and done npm install and rebuilt. I can see resolveRenameLocation in the vscode.d.ts definition.

Any ideas?

Yeah, we made a last-minute change and decided to call it prepareRename


Handshake error when querying medium over HTTPS

When running the following request:
let () =
  let _ =
    Lwt_main.run @@ Hyper.get "https://medium.com:443/feed/ahrefs/tagged/ocaml"
  in
  ()

I'm seeing the following error:
Fatal error: exception SSL connection() error: error:0A000410:SSL routines::sslv3 alert handshake failure

I don't reproduce this error in any other domain and RSS feeds I've tried to query.

Comparing the error message and this line:
https://github.com/aantron/hyper/blob/a16193c5369d379772765b549a393090d639373e/src/http/connect.ml#L72
I suspect, without confirming, that Hyper is not allowing SSL to negotiate SSLv3 with medium.com. It looks like SSLv3 is widely considered obsolete, but it should probably be an option to enable it. Also, there is the possiblity that there are other bugs in Hyper and/or ocaml-ssl that cause medium.com to try SSLv3.

In case it's useful, I hit the same thing with the github API:
# Hyper.get "https://api.github.com/zen";;
Exception: SSL connection() error: error:00000000:lib(0):func(0):reason(0)


Error: Cannot find module './generated/nexus-prisma'

I am trying to use Nexus with Prisma 1 and it gives this error when I try to start ./src/index.js.
yarn run v1.17.3
$ node src/index.js
internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module './generated/nexus-prisma'
Require stack:
- ~/prisma1-server/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (~/prisma1-server/src/index.js:6:23)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~/prisma1-server/src/index.js'
  ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have uploaded the code here → https://github.com/deadcoder0904/graphql-and-urql-by-example/tree/master/prisma1-server
I have the generated files so I don't know why it's not working. For additional context, here's prisma.yml ⸺
# Specifies the HTTP endpoint of your Prisma API.
endpoint: 'http://localhost:4466'

# Defines your models, each model is mapped to the database as a table.
datamodel: datamodel.prisma

# Specifies the language and directory for the generated Prisma client.
generate:
  - generator: javascript-client
    output: ../src/generated/prisma-client/
  - generator: graphql-schema
    output: ../src/generated/schema.graphql
hooks:
  post-deploy:
    - prisma generate
    - npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma

# Seeds initial data into the database by running a script.
seed:
  run: node ./prisma/seed.js

This is weird. So I was facing the same issue with Prisma 2 now that nexus-prisma is no longer a generator.
This is a TS example but I'm doing JS → https://github.com/prisma-labs/nexus-prisma/blob/master/examples/blog/package.json
So I didn't know how to generate nexus-prisma. While writing this draft, I found the answer so I hope it helps someone.
What I changed was removed generator nexus_prisma code from schema.prisma 👇
generator nexus_prisma {
  provider = "nexus-prisma"
}

Then I changed the import from
const {nexusPrismaPlugin} = require('@generated/nexus-prisma');

to
const {nexusPrismaPlugin} = require('nexus-prisma');

And installed nexus-prisma by doing
$ yarn add nexus-prisma

This made it work. Hope it helps :)

@deadcoder0904 Thanks For sharing your tips. I added a version of them to the release notes https://github.com/prisma-labs/nexus-prisma/releases/tag/v0.4.1.


Typo or intentional?

https://github.com/jasonacox/tinytuya/blob/de222a5bae96b0ef1bf0c5babf0d6e79648f13ce/tinytuya/scanner.py#L71
Is that supposed to be ablilty?

That's what devices report.  It's a typo on Tuya's part, just like boardcast.

Thanks for the insight. I searched the codebase and there were no code hits for 'ability' and only scanner.py for the typo. I was curious.


Add support for XDG directories

What changed?
Updates have been made to make use of the XDG Base directory specification if the environment variables are set on the users host machine.
config file is stored in $XDG_CONFIG_HOME
log file is stored in $XDG_STATE_HOME
FrecencyStore is stored in $XDG_CACHE_HOME
Why?
To de-clutter a users $HOME directory.
To attempt to resolve #570
How did you test it?
Tested locally with make cli with the environment variables set and unset. Went through initial configuration, assuming roles and uninstalling on macOS. I can install, setup, assume roles and uninstall with only 1 problem:
With the XDG environment variables set, I see the following error in the log file:
{"level":"debug","ts":"2024-08-07T13:57:19Z","msg":"upserting entry to frecency: open /Users/chris.harrison6/.cache/.dgranted/aws_profiles_frecency: no such file or directory"}

I must be missing a step somewhere because ~/.cache/.dgranted isn't being created. I'm fairly new to go and programming in general so any assistance would be very welcome. No doubt there will be a better way to achieve some of this, but thought I would get the ball rolling :smiley:
Potential risks
Unknown
Is patch release candidate?
Unknown
Link to relevant docs PRs
https://specifications.freedesktop.org/basedir-spec/latest/
https://wiki.archlinux.org/title/XDG_Base_Directory

Still seeing the error relating the cache folder. Not sure how to resolve this.

Thankyou @chris3ware 🙌

Just found granted today, seems great! Any chance of a release soon that'd include this? the latest 0.32 release predates this by a week


[Paper] Typing error when trying to pass component to PaperProps of Drawer

[x] I have followed (at least) the PR section of the contributing guide.

Closes https://github.com/mui/material-ui/issues/27703
Closes https://github.com/mui/material-ui/issues/32392
Problem:

the interface PaperProps doesn't have component as a key
e.g., <Drawer PaperProps={{ component:"..." }} ... /> displays a Typescript error
e.g., <Dialog PaperProps={{ component:"..." }} ... /> displays a Typescript error

Before:

Codesandbox

After:

Codesandbox

This is the type of Paper component:
declare const Paper: OverridableComponent<PaperTypeMap>;
OverridableComponent is using OverrideProps to add the props of the component to the typings. So for example if you had component="form", the Paper component would have React.FormEventHandler<HTMLFormElement> type for the onSubmit prop. You can test that with Paper component.
What I'm saying is that this isn't probably how it should be fixed but I'm not advanced enough in TS to do a PR myself.

Note that, this pattern is used in all components that support the component prop. At large, if we want to fix this problem, we would need to update the OverrideProps type. cc @michaldudak as this is used in the base package too.
Overall, I think that we should not use the PaperProps as a type in these components, but that may be another topic.

I think this approach is a workaround which is fine. To really fix the underlying problem, we have to revisit the Overriable... generic.

I think this approach is a workaround which is fine. To really fix the underlying problem, we have to revisit the Overriable... generic.

This fix won't let the user to use component specific props like onSubmit if form element is used as the component.

Overall, I think that we should not use the PaperProps as a type in these components, but that may be another topic.

@mnajdova In the DataGrid we use the xxxProps interfaces in a few places, #4654 is one example. Besides PaperProps, we would have to also apply the fix here to IconButtonProps and MenuItemProps, or we fix it in our side.

@m4theushw Thanks I just applied the diff P = { component?: React.ElementType }, to IconButtonProps and MenuItemProps as well.


ionic cordova android $http.post

$http.get('http://<IP_ADDRESS>/api/service/GetList').then(function(resp) {
alert(resp.status);
}, function(err) {
alert(err.statu);
})
internet explorer - chroom is working.
apk android run does not work

http://stackoverflow.com/questions/29826971/ionic-requests-return-404-only-on-android-in-chrome-it-works-fine
Just add whitelist plugin.. it will work.. It worked for me.. I was stucked from a week into this..!!

OK, so this one sounds like a general support question that was answered on SO, and the initial problem seems to come from changes in Cordova. Closing, as it doesn't seem to be AngularJS specific problem.

http plugin
cordova plugin add cordova-plugin-whitelist
I solved the problem by adding plugin

+1 whitelist worked for me.

@vurgun533 Yes.  add whitelist works!


Updates to the Resource Limits & Fees and Fees and Metering docs

I've got a couple questions and suggestions for the limits and fees docs we've got.

Ledger entry size (including Wasm entries) per Txn

Apparently the key and value are included as the entry. This is obvious when you think about it, but non-obvious at first glance.
Apparently the key size has a limit of 200 bytes. That's a big gotcha we aren't exposing anywhere that I'm aware of.

transaction size (bandwidth) and transaction size (history)

I don't understand the diff between between . Some examples and for-instances would go along way for ensuring people understand what this is. What is this btw?

“Target” ledger size

I have no idea what this is. We use the word in quotes as if we don't even really know what it is or how to explain it. This probably needs it's whole own section.

Temp entries

We don't clearly delineate the cost difference for utilizing temp entries. We mention something about coefficients and temp entries costing 1/10 that of persistent entries but it feels a bit dense and the math isn't obvious for a casual observer
We should include temp entry math in the Resource Limits table imo
We should definitely include an example scenario for temp entries in parallel with a persistent entry example for the same duration of time to clearly distinguish cost advantages of using temp entries

Temp entry rent period, ledgers vs Persistent entry rent period, ledgers

I don't know what these values are, I don't know why they matter, I don't understand why temp is double that of persistent

Write 1KB to ledger, stroops (current, 12 GB)

What does "current" mean? Current as in time the doc was originally published? Current as in right now? If current doesn't mean right now, which I can't imagine it does, I don't think we should use the concept of "current" at all. Unless we're committed to updating this doc every...week?

And another thing
How confident are we that we've included every reasonable fee in these tables? Looking through the core_metrics diagnostic events I'm seeing things like:

max_emit_event_byte

Do we have an upper bound for a single events data size like we do for ledger entries?

max_rw_code_byte

What is this and how is it different to max_rw_data_byte and max_rw_key_byte? Is it the amount of WASM written to the ledger for this txn?

invoke_time_nsecs

Do we have runtime limits?
Also the value I saw for this was 16636250 which is a wild value if invoke_time_nsecs is some sort of runtime value. But maybe it's not?

write_key_byte

I'm seeing a value for this as 0 when write_data_byte has a value. It seems odd to me you could write data without also writing a key. Is this a bug or just a misunderstanding of what this value is recording? I was under the impression that given env.storage().persistent().set(&key, &data); write_key_byte would record the byte size of &key and write_data_byte would record the byte size of &data. Am I wrong?

Here are some responses/explanations that need to be reflected in the docs.

Apparently the key and value are included as the entry. This is obvious when you think about it, but non-obvious at first glance.

Do you mean the key and value from the storage API standpoint? If so, then yes, this is all stored in the same contract entry. Moreover, the key also must include the contract id.

Apparently the key size has a limit of 200 bytes. That's a big gotcha we aren't exposing anywhere that I'm aware of.

That's indeed an oversight and this should be documented. The ledger key consists of the contract address (36 bytes) and the SCVal corresponding to the key in the contract storage call.

transaction size (bandwidth) and transaction size (history)
I don't understand the diff between between . Some examples and for-instances would go along way for ensuring people understand what this is. What is this btw?

Fair point, I don't think we need to distinguish between these for the purpose of the docs. Just a single fee per 1 KB of transaction size would make more sense. Semantically, transaction size contributes both into bandwidth (as we need to distribute the transaction among validators) and into history (because every transaction has to be stored in the history, forever). But practically only the combined fee matters.

“Target” ledger size
I have no idea what this is. We use the word in quotes as if we don't even really know what it is or how to explain it. This probably needs it's whole own section.

Yes, it would be great to just display the current write fee and only explain its computation logic in a separate, more in-depth doc. It doesn't make much sense in the fee reference. FWIW this is the size after which the write fees will increase very quickly. But I don't think this is generally useful  information, it's more about the network DOS protection and shouldn't be normally reached.

We don't clearly delineate the cost difference for utilizing temp entries. We mention something about coefficients and temp entries costing 1/10 that of persistent entries but it feels a bit dense and the math isn't obvious for a casual observer

Actually the coefficient is just 2 (i.e. the temp entry rent costs just 2x lower than persistent rent ATM). This should go down after some optimizations are done to Core. But I agree that it would be useful to clarify that the temp entries are cheaper because: a) Their rent is N times cheaper (just 2x currently) and b) when created, only 1 day of rent has to be paid upfront, vs 120 days for persistent entries. So for a short-lived temp entry (<= 1 day) the rent will cost 240 times cheaper than rent of a persistent entry of the same size. Again, the goal is to make this difference even higher in the future releases.

We should include temp entry math in the Resource Limits table imo

The only two numbers that are different for temp entries are the rent period and initial rent bump. Both are currently included into table: https://developers.stellar.org/docs/reference/resource-limits-fees#phase-1

Temp entry rent period, ledgers vs Persistent entry rent period, ledgers
I don't know what these values are, I don't know why they matter, I don't understand why temp is double that of persistent

The rent is computed by charging the write fee per every 'rent period' ledgers. E.g. if the write fee per 1 KB is 1000 stroops and the rent period is 5000 ledgers, then 10000 ledgers of rent of 1 KB would cost 1000 * 10000 / 5000 = 2000 stroops. So the higher the period, the lower the cost is. The explanation was probably accidentally dropped during one of the doc update iterations.

Write 1KB to ledger, stroops (current, 12 GB)
What does "current" mean? Current as in time the doc was originally published? Current as in right now? If current doesn't mean right now, which I can't imagine it does, I don't think we should use the concept of "current" at all. Unless we're committed to updating this doc every...week?

That was supposed to be 'current ledger size' and this indeed doesn't make much sense given the frequent changes in the ledger size. Instead we should just try to present the current write fee somehow and drop all the components (maybe move them to a doc with more detailed/technical explanations of the fee calculations).

How confident are we that we've included every reasonable fee in these tables?

All the fee-related info is in the table. Probably even more than necessary (like in the write fee case).

Looking through the core_metrics diagnostic events I'm seeing things like:

FWIW the core_metrics are precisely used for what the name suggests (various core metrics). They don't have to have anything to do with the fees/network limits. They are also not meant for usage in debugging. Maybe we should gate these by a separate config flag in order to avoid confusion.

Do we have an upper bound for a single events data size like we do for ledger entries?

No, we don't. Only the total size of emitted events + return value is limited.

max_rw_code_byte
What is this and how is it different to max_rw_data_byte and max_rw_key_byte? Is it the amount of WASM written to the ledger for this txn?

It's the max size of the contract code entry written by transaction.

invoke_time_nsecs
Do we have runtime limits?

No, we don't and we can't. This just stores the invocation time on this particular validator.

Also the value I saw for this was 16636250 which is a wild value if invoke_time_nsecs is some sort of runtime value. But maybe it's not?

This is just 16 ms, which seems plausible.

write_key_byte

This is actually never set, so it doesn't do anything. We'll clean this up.


Invalid ViewBinding on quick forward-back navigation in Fragments

If the Fragment is put in the back stack and then immediately restored with FragmentManager.popBackStack(), ViewBinding still points to old view during onViewCreated.
Here is a sample project to reproduce.
I suppose this is the same bug as in #35, but it is still reproducible with Fragments 1.3.0 and ViewBindingPropertyDelegate 1.4.4. So, as you suggested, I'm opening a new issue.

As midery pointed out, this is caused by mainHandler.post { viewBinding = null } in LifecycleViewBindingProperty.clear(). Calling viewBinding = null synchronously eliminates the bug.

I just want to add that LeakCanary reports leaks because of mainHandler.post { viewBinding = null } . What the reason was for using mainHandler?

That's behaviour was added, because Fragment.onDestroyView() called after Lifecycle.onDestroy()

Yes, I remember well your article on the subject. But it has this unfortunate side-effect.

subscribing to updates

This issue is plaguing my application as well.

@kirich1409 Your awesome blog post in September about leveraging Kotlin's property mechanics inspired me to write similar code, while not as advanced as your library, the mechanism is the same, and I have encountered similar bugs as you. Recently the issue on quick fragment navigation described in this post by @gmk57 .
I've come up with a solution that seems to work for me, maybe this can also work for your library?
https://github.com/corona-warn-app/cwa-app-android/pull/2913
I null the viewBinding before rerunning the initialization if I noticed that the LifeCycle.onDestroy triggered, but the Runnable { viewBinding = null } didn't.

@d4rken , I will check your solution. Thanks

Any updates?

@d4rken , I've checked the solution, but it will help if getValue() is called. But if not we will have memory leak

As a solution for Fragment I've tried
private class FragmentViewBindingProperty<in F : Fragment, out T : ViewBinding>(
    viewBinder: (F) -> T
) : LifecycleViewBindingProperty<F, T>(viewBinder) {

    private var fragmentLifecycleCallbacks: FragmentManager.FragmentLifecycleCallbacks? = null

    override fun getValue(thisRef: F, property: KProperty<*>): T {
        registerFragmentLifecycleCallbacks(thisRef)
        return super.getValue(thisRef, property)
    }

    private fun registerFragmentLifecycleCallbacks(fragment: Fragment) {
        if (fragmentLifecycleCallbacks != null) {
            return
        }

        fragmentLifecycleCallbacks = ClearOnDestroy().also { callbacks ->
            fragment.parentFragmentManager
                .registerFragmentLifecycleCallbacks(callbacks, false)
        }
    }

    override fun clear() {
        super.clear()
        fragmentLifecycleCallbacks = null
    }

    override fun getLifecycleOwner(thisRef: F): LifecycleOwner {
        try {
            return thisRef.viewLifecycleOwner
        } catch (ignored: IllegalStateException) {
            error("Fragment doesn't have view associated with it or the view has been destroyed")
        }
    }

    private inner class ClearOnDestroy : FragmentManager.FragmentLifecycleCallbacks() {

        override fun onFragmentDestroyed(fm: FragmentManager, f: Fragment) {
            // Fix for destroying view for case with issue of navigation
            postClear()
        }
    }
}

I don't like that solution, but it must solve the issue with Lifecycle

Another possible approach is described here, but I haven't tried it yet.