Merge "write the diff number into Settings and take care of read_only" into main